February 2019
Intermediate to advanced
204 pages
4h 52m
English
JavaScript functions that take actions and states as input and return the new states are reducers. Well, if this is confusing, try to keep in mind that the action only describes what happened, not how the application state transforms.
It is very important to understand the reducer function. Let's consider our hospital management system. Our application's state can look like the following:
{ doctors: [ { name: "John Doe", department: "Radiology", address: "Kathmandu, 4017, Nepal", telecom: "999-999-999" }, { name: "Ola Nordmann", department: "General Physician", address: "Kong Oscarsgate 29, 5017, Bergen, Norway", telecom: "111-111-1111" } ];}
When creating a reducer function, it is important that we remember the reducer principle: ...
Read now
Unlock full access