Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Sean Lynch edited this page Jul 7, 2017 · 65 revisions

Tutorials

Videos

Rally Coding

Libraries

Persist state

  • redux-persist - Persist and rehydrate a redux store
  • redux-storage - Persistence layer for redux with flexible backends
  • redux-offline - Build Offline-First Apps for Web and React Native. Built upon redux-persist

Consuming APIs

Testing

Other

Tools

Comparison

Examples

const reducer = (state = defaultState, action) => {
  switch (action.type) {
    case ADD_TODO: {
      return { ...state, [action.payload.id]: action.payload }
    }

    case EDIT_TODO: {
      return { ...state, [action.payload.id]: action.payload }
    }

    case REMOVE_TODO: {
      const { [action.payload.id]: removedTodo, ...remainingTodos } = state;
      return remainingTodos;
    }

    default:
      return state;
  }
}

Reference

Clone this wiki locally