Public
Script
Readme

Testing recursively filling in default values in immutable JS records

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { Record } from "npm:immutable";
const defaultRecordValues = {
rootLevel: "test root",
nested: {
x: 1,
y: 2,
},
};
const MyRecord = Record(defaultRecordValues);
const r = new MyRecord({ nested: { x: 3 } });
console.log(r);
export { r };
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 24, 2023