You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the current store configuration is quite powerful, but quite verbose, too and when having a more complex store which should subscribe multiple events and contains a complex state tree, it's better to make the configuration more intuitive.
Proposal
Instead we could create a subscription API which creates the object internally:
The current approach to obtain single parameters that are extracted from the dispatcher payload by the connect.js isn't a good approach, so we should deprecate it.
Instead we should communicate with objects in order to simplify moving in handlers.
All legacy handlers should still receive support if they don't use this new feature.
Furthermore it would simplify a lot of things as we can simply pass around objects (the old params is not needed anymore, if param1 is absent for instance, the ES6 engine will throw an exception on its own, so the whole legacy code can be deprecated to speed up the state handling)
some parts of the tool growed, so a perf measurement tool has been introduced (mocha-perf-reporter) where a max ms time can be asserted to investigate how long certain operations take
added `publish` to single callback handlers and avoid re-creation of these handlers to speedup actions in long-running apps (SPAs)
resolves#35
references #34
Description of the issue
the current store configuration is quite powerful, but quite verbose, too and when having a more complex store which should subscribe multiple events and contains a complex state tree, it's better to make the configuration more intuitive.
Proposal
Instead we could create a subscription API which creates the object internally:
This would make everything much more readable.
It could be also possible to chain multiple handlers:
And when the state needs to be copied, no function needs to be composed and the argument can be omitted:
New feature: modify state sections
State might be composed of multiple recursive sections:
Now the implementation might look like this:
Then it would gather all the params defined in the first array and merge them into the section.
New feature: old state in callbacks
All handlers should be able to access to old state easily.
To solve this, one last argument should be added to each handler:
This argument is always the last one and can be omitted, so no BC break here.
The text was updated successfully, but these errors were encountered: