0.0.0 • Published 7 years ago

rapid-io-redux v0.0.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
7 years ago

Rapid IO Redux

Build Status codecov

This is a library for easily binding a rapid.io collection to redux.

Installation

npm install --save-dev rapid-io-redux

Usage

const rapid = require("rapid-io")
const connector = require("rapid-io-redux")
const client = rapid.createConnection("<your api key>")
const collection = client.collection("your collection")

cosnt store = ... // get this from somewhere else

connector(store, collection, {
   delAction: "DELETE_ITEM",
   addAction: "ADD_ITEM",
   changeAction: "CHANGE_ITEM"
});

Now whenever an item is added, deleted, or changed an action will be dispatched. The third paramater to connector is an object listing the action types associated with each event. This library uses Flux Standard Actions, and all dispatched actions are in the following form.

{
    type: String
    payload: Object
}

Legal

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

0.0.0

7 years ago