Comments (8)
I think is not the way to go since you retrieve a snapshot from the server. A Get req gives you a snapshot image.
And rebuild state then should be done with closer to the snapshot than try to run through a chain of effects IMHO. It will be very hard in the local what is event handler vs what shall execute business logic ect.
Plus as you said the overhead will be big for the sake of none.
When the ui has rendered all the event handling should be up as soon as possible.
from dispatchr.
Rehydrtaion of stores through replay will bring it much closer to event sourcing ideas. We are currently experimenting with replay and it works well. There are only a handful of events being replayed so performence has not been an issue. It would definitely be great to see support for that directly in the library.
from dispatchr.
Yeah, I think it depends on the application, so it could be a configuration option. The implementation should be fairly simple. I'm totally willing to add this in if someone wants to do a PR.
from dispatchr.
If the dehydrate / rehydrate methods won't go away what's the purpose ?
The goal was to reduce code right so in that case I would say there should be a single way to do the state mgmt on client side init.
But hey I'm a purist and like simplicity.
On 17 Feb 2015, at 23:06, Michael Ridgway [email protected] wrote:
Yeah, I think it depends on the application, so it could be a configuration option. The implementation should be fairly simple. I'm totally willing to add this in if someone wants to do a PR.
—
Reply to this email directly or view it on GitHub.
from dispatchr.
The need for each store to define dehydrate/rehydrate would go away. With replay, it would just re-dispatch the events on the client.
from dispatchr.
Right, It felt like you wanted both. I could def see the benefit by having a self solving rehydration.
from dispatchr.
Could we add an standard dehydrate / rehydrate to the BaseStore? Those methods could just set/get this.state
which is what is done in most cases.
from dispatchr.
Elegant idea. Either that or a mixin would work.
from dispatchr.
Related Issues (20)
- Investigate Synchronous Dispatching
- Handler definitions as functions to promote a sort of Revealing Module Pattern
- Add helper functions to Readme
- Bowerify the dispatchr HOT 3
- Encourage passing constructors to getStore and waitFor instead of strings HOT 1
- Ability to have handler for all actions HOT 4
- React errors caused by BaseStore emit do not reach the console HOT 3
- can emitChange from store support passing a paylod that holds an id HOT 6
- Pull `/utils/BaseStore.js` into it's own module HOT 2
- Does createStore support mixing in event handlers? HOT 3
- Introduce store method `shouldDehydrate` to disable dehydration for a store HOT 2
- Errors during action handlers HOT 5
- require('util'), why? HOT 19
- Why the Dispatcher don't return the class directly? HOT 11
- Throw an error if actionName passed to Dispatcher#dispatch is undefined HOT 4
- docblock incorrectly mentions queueing
- Tie together multiple actions of one async operation HOT 2
- createStore does not expose store in dehydrated context.dispatcher.stores HOT 3
- Unable to affect state asynchronously from store, apply component `this` to handler function? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dispatchr.