Fluxo is a simple, lightweight (~300LOC) and dependency free data infrastructure lib based on Facebook Flux and Backbone.js. It's compatible with React.js, but you can use with whatever you want to the view/component layer.
var jonh = Fluxo.ObjectStore.create({
data: { name: "John Doe" }
});
var people = Fluxo.CollectionStore.create({
stores: [{ name: "John Doe" }],
store: { ...custom behavior to children store... }
});
Notice the ObjectStore.create today is something like Fluxo.extend(myBlueprint, Fluxo.ObjectStore), so we need place our initial data on data property of our object that will goes be enhanced, but on the CollectionStorewe pass the initial data to children stores without the data property because the blueprint application for children stores occours using the store property of collection store.
So, I was thinking to normalize this making the first argument of ObjectStore.create be the attributes of the new created stores and the second forward argument be the blueprints. Like this:
var john = Fluxo.ObjectStore.create({ name: "John Doe" }, {
sayYourName: function () {
alert(this.data.name);
}
});
Remeber: blueprint are the new name that we going to call the extensions to stores (https://github.com/fluxo-js/fluxo/pull/4#issuecomment-144563805).
Today we have:
Notice the
ObjectStore.create
today is something likeFluxo.extend(myBlueprint, Fluxo.ObjectStore)
, so we need place our initial data ondata
property of our object that will goes be enhanced, but on theCollectionStore
we pass the initial data to children stores without thedata
property because the blueprint application for children stores occours using thestore
property of collection store.So, I was thinking to normalize this making the first argument of
ObjectStore.create
be the attributes of the new created stores and the second forward argument be the blueprints. Like this: