Comments (3)
Hi! Thanks for the feedback.
I agree that this seems redundant if your stores only contain JSON stringifiable (is that a word?) data, but it's often the case that Store data is not JSON stringifiable — for instance, using Immutable.js data types. In that case, JSON.stringify()
and JSON.parse()
will not work, hence the current solution, which is just to let the user define how to serialize and deserialize state.
The calls to JSON.stringify()
and JSON.parse()
you've identified in the code are only for the top-level tree of store keys to store data strings. So the parsed object looks like this:
{
storeA: '{"foo": "bar"}', // String of JSON stringified data, but it could actually be anything returned by `Store#serialize()`
storeB: '{"foo": "bar"}'
}
Then we iterate over the values and send the strings to the stores for deserialization. In other words, Flux#deserialize
makes no assumptions about the type of data in your stores.
Does that make sense? I'm open to suggestions for how to make this better.
from flummox.
Ah! I read your comment again, and looked at the code again, and now I see the real issue — I'm passing the entire state string to Store#deserialize
, not the store string! Oops! I'll fix this right away.
My previous comment is how it should work, though, so if you have any suggestions for how it could be better I'd still like to hear them :)
from flummox.
Fixed in 2.5.1
from flummox.
Related Issues (20)
- how to get a child component input value HOT 1
- Missing getActionsAsObject from Actions HOT 5
- Incorrect params passed to async begin handler HOT 1
- More topic guides needed in doc HOT 1
- Context differs problem
- Do not pass flux prop to components wrapped with `connect` HOT 6
- Use Redux HOT 6
- Explanation in README as to why a switch to Redux should be made HOT 5
- Import flummox/component fails with 4.0.0-rc1 HOT 1
- unable to make flummox work with react-router 1.0.0-beta3 HOT 2
- Actions.js grabs all console logs HOT 4
- Wrong link in why-flux-component-is-better-than-flux-mixin.md
- Considering the numbers HOT 1
- Support for React 0.14 HOT 17
- How to only use custom stateGetter for subset of subscribed stores HOT 1
- Maintain module? HOT 4
- FluxComponent does not work on IE10 HOT 24
- Flummox 3.6 is incompatible with IE8 HOT 3
- TestUtils removed from NPM HOT 2
- Deprecation warning with React 15.5 HOT 1
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 flummox.