0.0.1 • Published 9 years ago

ampersand-state-fluxible-mixin v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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-mixin

Usage

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