0.0.1 • Published 10 years ago
ampersand-state-fluxible-mixin v0.0.1
Ampersand State Fluxible Mixin
This module implements the dehydrate and rehydrate methods for
Ampersand.js states and models to be used as Fluxible Stores.
Install
npm install --save ampersand-model-fluxible-mixinUsage
Define your model with the mixin and set the storeName for Fluxible:
// MyModel.js
var Model = require("ampersand-model");
var mixin = require("ampersand-model-fluxible-mixin");
var MyModel = Model.extend(mixin, {
  props: {
    that: "string"
  }
});
MyModel.storeName = "MyModel";
module.exports = MyModel;Then, register your model with Fluxible:
// app.js
var Fluxible = require("fluxible");
var MyModel = require("./MyModel");
var app = new Fluxible({ /* options... */ });
app.registerStore(MyModel);
module.exports = app;You may then use Fluxible according to the API.
License
MIT
0.0.1
10 years ago