- Users want to compose reducer tree across modules
- Idea of a single reducer function makes it difficult for the library to dynamically augment the shape of the state tree
- Turning control over to the library to build the root reducer limits the use of meta-reducers
- Feature modules may inadvertently collide with the state of the root module
- Library authors may want to leverage @ngrx/store in their projects and provide an easy way
This recipe is useful for cooking up chained API calls as a result of a single action.
In the below example, a single action called POST_REPO
is dispatched and it's intention is to create a new repostiory on GitHub then update the README with new data after it is created.
For this to happen there are 4 API calls necessary to the GitHub API:
- POST a new repostiry
- GET the master branch of the new repository
- GET the files on the master branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function md5(inputString) { | |
return Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, inputString) | |
.reduce((output, byte) => output + (byte & 255).toString(16).padStart(2, '0'), ''); | |
} |