GithubHelp home page GithubHelp logo

trejgun / redux-crud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from versent/redux-crud

0.0 3.0 0.0 426 KB

A set of standard actions and reducers for Redux CRUD Applications

HTML 1.16% JavaScript 10.85% TypeScript 87.99%

redux-crud's Introduction

Redux CRUD

Codeship Status for Versent/redux-crud

Redux CRUD is a convention driven way of building CRUD applications using Redux. After building several Flux applications we found that we always end up creating the same action types, actions and reducers for all our resources.

Redux CRUD gives you a standard set of:

  • action types: e.g. USER_UPDATE_SUCCESS
  • actions: e.g. updateSuccess, updateError
  • reducers: for the action types above e.g. updateSuccess

Working with resources in Redux

When building an app you might have resources like users, posts and comments.

You'll probably end up with action types for them like:

  • USERS_FETCH_SUCCESS
  • POSTS_FETCH_SUCCESS
  • COMMENTS_FETCH_SUCCESS

And action creators like:

  • users.fetchSuccess
  • posts.fetchSuccess
  • comments.fetchSuccess

There's obvious repetition there. Redux CRUD aims to remove this boilerplate by providing strong conventions on naming and processing data.

Stores

Redux-crud provides two stores:

  • List. A plain JS array. This preserves the order of records.
  • Map. A JS object where records are indexed by key. This provides faster writes and lookups.

Docs

Testing

npm test

Example

You can see a basic example here

redux-crud's People

Contributors

alexicum avatar bbb avatar bramdevries avatar jakubbarta avatar latentflip avatar mattvague avatar mjhm avatar yagudaev avatar

Watchers

 avatar  avatar  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.