This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

mobx-jsonapi-store
TypeScript icon, indicating that this package has built-in type declarations

4.4.0 • Public • Published

mobx-jsonapi-store

JSON API Store for MobX

Don't need any JSON API specific features? Check out mobx-collection-store.

Can be used with Redux DevTools.

Build Status Test Coverage npm version

Dependency Status devDependency Status Greenkeeper badge

Basic example

import {Store} from 'mobx-jsonapi-store';
 
const store = new Store();
const user = store.sync(userResponse); // Assumption: userResponse was received from some API call and it's a valid JSON API response
console.log(user.name); // "John"

For more, check out the Getting started guide.

Installation

To install, use npm or yarn. The lib has a peer dependency of mobx 2.7.0 or later (including MobX 3) and mobx-collection-store.

npm install mobx-jsonapi-store mobx-collection-store mobx --save
yarn add mobx-jsonapi-store mobx-collection-store mobx

Since the lib is exposed as a set of CommonJS modules, you'll need something like webpack or browserify in order to use it in the browser.

Don't forget to prepare your code for production for better performance!

Migration from v3 to v4

Version 4 has a few breaking changes described in the migration guide.

Getting started

The main idea behind the library is to have one instance of the store that contains multiple model types. This way, there can be references between models that can handle all use cases, including circular dependencies.

JSON API Spec

mobx-jsonapi-store is 100% compatible with the JSON API v1.0 spec

API reference

License

The MIT License

Credits

mobx-jsonapi-store is maintained and sponsored by Infinum.

/mobx-jsonapi-store/

    Package Sidebar

    Install

    npm i mobx-jsonapi-store

    Weekly Downloads

    3

    Version

    4.4.0

    License

    MIT

    Unpacked Size

    507 kB

    Total Files

    76

    Last publish

    Collaborators

    • infinumcom
    • jjanus
    • danipavic
    • safo6m
    • fvoska
    • darkokukovec
    • infinumco