Most implementations rely on the flux stores being singletons which can't work for multiple requests on the server.
The only one that's isomorphic is yahoo's but that one feels terribly verbose.
Most implementations rely on the flux stores being singletons which can't work for multiple requests on the server.
The only one that's isomorphic is yahoo's but that one feels terribly verbose.
I've been making an app based on yahoo's dispatchr (part of fluxible) for about 4 months now, and I hardly spend time with the "verbose" part of my app. All the real work is in data fetching, view rendering, business logic, and so on.
Really, if there's X libraries out there and X-1 don't support isomorphic apps, and the only complaint you can come up with about the one that does is that the most boring, logic-free and error-free part of your app will look a little verbose, then what are you still waiting for?
I imagine you could extend this to use Flux relatively easily - most of the hard stuff is done, and the code base is quite small.
https://github.com/appsforartists/ambidex-example--bike-inde...
It instantiates a new Reflux store for each request, and uses data in the URL to figure out which stores to populate before rendering.
Shameless plug: Fynx[0] is mostly synchronous, for example.
I want to have the same routing and data fetching logic both on the client and on the server, and for that I would need to have stores that are independent for different incoming HTTP requests.
Btw. I would love to see a full example of an isomorphic Flummox application using react-router.
That, combined with the fact that all CommonJS modules are singletons, anyway.
Which part of Fluxible feels verbose?
It would be cool if there was a nice way that you could wrap an action with a function to generate that boilerplate for you, similar to how Bluebird's `Promise.promisify(myFunction)` generates a Promise-wrapped function for anything following the typical Node callback style.
It would be much nicer to have e.g.:
context.actions.myAction('foo', 'bar')
And onMyAction: function(foo, bar)
- dealing with asynchronous data fetches. The example shows that you should create 3 actions for every async data action: FETCH_STARTED, FETCH_COMPLETE and FETCH_ERROR.How would you deal with cases where you need to fetch multiple data sources then combine them? Seems like the number of actions would quickly explode. Also, how would you deal with dependencies and errors?
- the service api:
context.service.read('message', {}, {}, function (err, messages)
too many optional params, kinda hard to keep track what goes where.I'd prefer something with promises.
- I also miss query params support in fluxible router