Tutorial by Examples

A basic reducer would look like this: // Import the action types to recognise them import { ACTION_ERROR, ACTION_ENTITIES_LOADED, ACTION_ENTITY_CREATED } from './actions'; // Set up a default state const initialState = { error: undefined, entities: [] }; // If no state is provi...
Immutable is a great library that provides us with immutable versions of widely used types of collections, such as Lists, Stacks, Maps, and more. It simplifies the manipulation of the state and makes it easier to make pure calculations and avoid mutation. Let's see how the Basic reducer can be rew...
// Import the action types to recognize them import { ACTION_ERROR, ACTION_ENTITIES_LOADED, ACTION_ENTITY_CREATED } from './actions'; // Set up a default state const initialState = { error: undefined, entities: [], loading: true }; // If no state is provided, we take the defa...

Page 1 of 1