Code Monkey home page Code Monkey logo

mobx-jsonapi-store's Introduction

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!

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's People

Contributors

darkokukovec avatar greenkeeper[bot] avatar greenkeeperio-bot avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.