feat(Schematics): add success/failure effects/actions to ng generate feature#1530
feat(Schematics): add success/failure effects/actions to ng generate feature#1530brandonroberts merged 9 commits into
Conversation
|
I'm updating the unit tests on this schematic to match the new code |
|
Preview docs changes for 99bc13b at https://previews.ngrx.io/pr1530-99bc13b/ |
|
Preview docs changes for 674056f at https://previews.ngrx.io/pr1530-674056f/ |
|
Looks like the bazel build step failed but it was a timeout issue: #!/bin/bash -eo pipefail
yarn
yarn install v1.10.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
Too long with no output (exceeded 10m0s) |
|
We'll investigate if it keeps timing out. Some initial feedback:
|
|
Preview docs changes for 674056f at https://previews.ngrx.io/pr1530-674056f/ |
That all sounds good to me. Just one question regarding tests.... How should I handle a current test that is going to fail now because the |
|
Preview docs changes for 4615abf at https://previews.ngrx.io/pr1530-4615abf/ |
|
Preview docs changes for 7cb5bb2 at https://previews.ngrx.io/pr1530-7cb5bb2/ |
|
@brandonroberts regarding tests, nevermind, I get what you're saying, I will create new tests that test the schematics with the new flag enabled. The current tests will be reverted to match exactly as before as they are testing with the flag disabled by default. Sorry for the confusion. |
|
Preview docs changes for 9012cc3 at https://previews.ngrx.io/pr1530-9012cc3/ |
…f api flag enabled
|
@brandonroberts latest commit includes...
|
|
Preview docs changes for 1a7bf87 at https://previews.ngrx.io/pr1530-1a7bf87/ |
|
Preview docs changes for 006a2bc at https://previews.ngrx.io/pr1530-006a2bc/ |
|
Preview docs changes for 8c059cb at https://previews.ngrx.io/pr1530-8c059cb/ |
| load<%= classify(name) %>s$ = this.actions$.pipe( | ||
| ofType(<%= classify(name) %>ActionTypes.Load<%= classify(name) %>s), | ||
| concatMap(() => | ||
| EMPTY.pipe( |
There was a problem hiding this comment.
I feel like we need some comment here to tell the user to replace the empty observable?
| EMPTY.pipe( | |
| /** An EMPTY observable only emits completion. Replace with your own observable API request */ | |
| EMPTY.pipe( |
There was a problem hiding this comment.
That makes sense to me.
|
Preview docs changes for 8091938 at https://previews.ngrx.io/pr1530-8091938/ |
|
LGTM. Docs for https://ngrx.io/guide/schematics/feature can be done separately. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #1529
Should resolve #1524
What is the new behavior?
The PR enhances the default effect generated for feature.
LoadFeatureSuccessandLoadFeatureFailureLoadFeatureaction sets loading to trueLoadFeatureSuccessaction sets loading to false, nulls error property and updates data with payload.LoadFeatureFailureaction sets loading to false, populates error from payloadloadFeatureEffect$to demonstrate the idea of a request action, and then based on the return of an observable dispatch a success or failure action.Does this PR introduce a breaking change?
Other information