Skip to content

olafura/PouchFlux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bf7c3f7 · Aug 13, 2015

History

34 Commits
May 3, 2015
Aug 13, 2015
Apr 28, 2015
May 3, 2015
May 3, 2015
May 3, 2015
Mar 30, 2015
May 3, 2015
Aug 13, 2015

Repository files navigation

PouchFlux

Flux with PouchDB

Simple example

Action

var alt = require('../alt');
var PouchActions = require('pouchflux/lib/PouchActions');

class ExampleActions extends PouchActions {
}

module.exports = alt.createActions(ExampleActions)

Store

var alt = require('../alt');
var PouchStore = require('pouchflux/lib/PouchStore');

var ExampleActions = require('../actions/ExampleActions');

var exampleStore = alt.createStore(class ExampleStore extends PouchStore {
  constructor() {
    super('exampleStore');
    this.bindActions(ExampleActions)
  }

});
module.exports = exampleStore;

You can choose to set the database name with the super function or later with the PouchActions.changeName({'name':'exampleStore'});

A more detailed example is in the ported version of the TodoStore from Alt.