3 ms·
I've done plenty of work with immutable data, and I tend to code in a way that minimizes the amount of state I have to manage. I guess that's what I was saying
by aidos 10y ago
I've done plenty of work with immutable data, and I tend to code in a way that minimizes the amount of state I have to manage.
I guess that's what I was saying about mobx though - I can have a much smaller set of core data and then pure functions for the layers of derived data. And it's a) easy to reason about and b) super performant at managing the calculations.
Aliasing bugs don't really apply in JS, unless there's some variation of the term? Stale caching is also not an issue with calculated derived data.
- nine_k 10y agoSaying about "aliasing bug" I meant something like this: var my_data = {"foo": null} function innocuous(input) { var data = {"one": input, "two": something()}; data.input.foo = data.input.foo || "foo" // set a default value // do something with data } var result = innocuous(my_data) // Oops, now my_data.foo has changed.