dustingetz / react-cursor

Immutable state for React.js
1.03k stars 50 forks source link

Deprecate and remove apply function #59

Closed lijunle closed 8 years ago

lijunle commented 9 years ago

\cc @dustingetz @danielmiladinov

After this change, the usage syntax for apply function looks weird.

Are we going to deprecated/remove this API?

dustingetz commented 9 years ago

I think so - .apply is now just the same as .set, right?

lijunle commented 9 years ago

Yes, the following two code snippets do the same thing exactly:

a.apply(function (prevState) {
  return function (x) { return x / 8 }
});
a.set(function (x) {
  return x / 8;
});
dustingetz commented 9 years ago

@ezmiller, here's a low hanging fruit PR if you want a warmup task!

dustingetz commented 8 years ago

The 2.0 changes to decouple from react impact this issue in ways that were not obvious to me. This will need to be thought through more deeply and resolved. There's currently a failing test ("apply against store") demonstrating the problem.

dustingetz commented 8 years ago

I'm wrong, the test was broken due to my dumb error, apply works fine against stores