-
Notifications
You must be signed in to change notification settings - Fork 141
support two way data binding #64
Comments
I'm not going to fix observ-array tonight. There's a bunch of complexity in this problem domain. |
@Raynos can you please describe the problem? thanks |
@Raynos this may provide some insight... not sure if it's too slow though... but thought it might help... |
I think we fixed observ-array, cannot remember. |
See this issue ( Raynos/observ-array#9 ). cc @kuraga I never verified whether all the edgecases were handled. Also see nrw/observ-varhash#1 |
Hm... It's difficult to understand, when notes about issues are posted in different components' repositories 😄 |
@kuraga distributed conversations :) hard to find them. It's also not fully documented what two way data binding means. it basically means that if you mutate either the parent or child in both the parent & child get updated. var parentArr = hg.array();
var childArr = hg.array();
parentArr.push(childArr);
childArr.push(4);
parentArr.get(0).get(0) === 4;
parentArr.set([
[5]
])
childArr.get(0) === 4;
parentArr.get(0).get(0) === 5; I'm not really sure what I want the semantics to be in all the edge cases tbh... Whatever makes time travel work. The whole point is to be able to serialize the entire state of the world at any time and bring it back at any other time. which means |
@nrw does it mean than we can use |
@kuraga |
I'm looking everything to understand every line of |
i see. :) If you look at the source, |
I use struct to communicate "these are fixed keys" I use varhash to communicate "there are N keys" There is a different, a struct can be like struct({ n: string, m: number }) |
@Raynos or anyone, could you explain this a little further (what would/wouldnt make time travel work, what are examples of edge cases in the context of Raynos sample above)? im a bit new to all this, but may contribute as im noticing observ-array being a bottleneck in my project |
@cellvia last time I looked at this I observed that using Most of the time you have an array of objects; you can just create a varhash indexed by id or |
cc @nrw
The text was updated successfully, but these errors were encountered: