rpominov / fluce

[DEPRECATED] Flux with immutable data and pure action handlers
MIT License
76 stars 1 forks source link

Serialization and deserialization #5

Open rpominov opened 9 years ago

rpominov commented 9 years ago

Perhaps it's a good idea if stores could also provide functions for serialization and deserialization of their state. Something like:

const myStore = {
  initial() { /*...*/ },
  serialize(storeState) { /* must return string */ },
  deserialize(stateAsString) { /* returns state */ },
  reducers: { /*...*/ }
}

Then we could implement str = fluce.serialize() / fluce.deserialize(str), which can be used to send current state from server in an isomorphic app.