0.2.0 • Published 8 years ago

cerebral-hoodie v0.2.0

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

cerebral-hoodie

Hoodie-powered persistent store with sync API package for Cerebral

NPM version

Install

npm install cerebral-hoodie

Usage

var controller = require('./controller')
import Hoodie, { Store } from 'cerebral-hoodie'

const store = new Store('dbName', {
  remoteBaseUrl: location.origin + '/api'
})

controller.register({
  hoodie: Hoodie(store, {
    path: ['data'], // where to sync hoodie.store
    connect: true   // auto-connect to remote store after attach
  })
})

Do not mutate synced objects in cerebral's state store. Use hoodie.store.* API exposed as service instead.