redux-jarm

0.0.24 • Public • Published

redux-jarm

Build Status Coverage Status npm version Downloads

Offline-first redux ORM designed around JSONAPI servers.

API specification

Check out the full API Specification.

Additional resources:

Requirements

Jarm requires you to be using redux and redux-thunk in your middleware.

Installation

Install the package with yarn / npm:

yarn add redux-jarm
# npm install redux-jarm

Instantiate a Jarm object with your config:

import { createJarm } from 'redux-jarm'

const Jarm = createJarm({
  baseUrl: 'https://example.com/api'
  storeKey: 'models',
  schema: {
    User: {
      url: '/users/',
    },
  },
})

Register Jarm in your store's reducer:

import { createStore, combineReducers, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'

import Jarm from './jarm.js'

const reducer = combineReducers({
  models: Jarm.reducer,
})
const store = createStore(reducer, applyMiddleware(thunk))

Optionally, you can persist your Jarm state as documented here.

Readme

Keywords

none

Package Sidebar

Install

npm i redux-jarm

Weekly Downloads

1

Version

0.0.24

License

MIT

Unpacked Size

30.4 kB

Total Files

6

Last publish

Collaborators

  • bor3ham