fluce icon indicating copy to clipboard operation
fluce copied to clipboard

Serialization and deserialization

Open rpominov opened this issue 10 years ago • 0 comments
trafficstars

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.

rpominov avatar May 30 '15 21:05 rpominov