Created
July 19, 2015 13:46
-
-
Save baio/2b08b7eef4879fa7ba04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ABRecord = Immutable.Record({a:1, b:2, c : null}); | |
var myRecord1 = new ABRecord(Immutable.fromJS({a:2, b: 4, c: { d: ["one"]}})); | |
var myRecord2 = new ABRecord(Immutable.fromJS({a:2, b: 4, c: { d: ["one"]}})); | |
console.log(Immutable.is(myRecord1, myRecord2)); | |
console.log(myRecord1.c.get("d").get(0)); | |
/// | |
var NestedRecord = Immutable.Record({d : null}); | |
var ABRecord1 = Immutable.Record({a:1, b:2, c : null}); | |
var myRecord3 = new ABRecord1(Immutable.fromJS({a:2, b: 4, c: new NestedRecord({ d: "one"})})); | |
var myRecord4 = new ABRecord1(Immutable.fromJS({a:2, b: 4, c: new NestedRecord({ d: "one"})})); | |
console.log(Immutable.is(myRecord3, myRecord4)); | |
console.log(myRecord3.c.d); | |
//// | |
var NestedRecord = Immutable.Record({d : null}); | |
var ABRecord1 = Immutable.Record({a:1, b:2, c : null}); | |
var myRecord3 = new ABRecord1(Immutable.fromJS({a:2, b: 4, c: new NestedRecord({ d: "one"})})); | |
var myRecord4 = new ABRecord1(Immutable.fromJS({a:2, b: 4, c: new NestedRecord({ d: "one"})})); | |
console.log(Immutable.is(myRecord3, myRecord4)); | |
console.log(myRecord3.c.d); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment