Skip to content

masylum/mobx-rest-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mobx-rest working example

I hacked this little project to show how to use mobx-rest.

You can access the demo here.

To build it I did the following:

npm install -g create-react-app
create-react-app demo
cd demo
yarn start

With this you can have an up and running react app :) Next was to install the dependencies:

yarn add mobx
yarn add mobx-react
yarn add mobx-rest
yarn add mobx-rest-fetch-adapter

After this I created the 3 stores:

  • users
  • todos
  • comments

And you are good to go!

Comments

API

I'm using JSON Placeholder API to implement this example. The API is not persistent, so only one comment can be fakely created (always returns id 501).

Decorators

I highly recommend for your project to use decorators since the API is much more cleaner with them but as I showed in this example, it's not needed to get started.

About

Example project built with mobx-rest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •