Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: migrate to NgRx v8 creators #4

Merged
merged 7 commits into from
Sep 10, 2019
Merged

Conversation

wesleygrimes
Copy link
Collaborator

  • migrate to use createAction instead of classes, enums and type unions
  • migrate to use createReducer over switch statements
  • migrate to use createEffect

Digging through the code I saw some OOP concepts at play with regards to the HeroAction and VillainAction abstract classes. This played nicely into creating a couple higher order functions that can be composed. As such, I created create*Action and create*ErrorAction for both heroes and villains.

The one area I did have a hard time in converting was the effects that used the toAction helper. Once we release in NgRx the mapToAction operator, this will become a lot easier.

Another option would be to create a "higher order" effect like I propose here: ngrx/platform#1826 To standardize the way effects are composed.

Let me know what you think and if you have any questions.

@wesleygrimes wesleygrimes requested a review from johnpapa July 21, 2019 01:56
@wesleygrimes wesleygrimes changed the title Migrate to creators refactor: migrate to NgRx v8 creators Jul 21, 2019
@johnpapa johnpapa merged commit 299ac49 into master Sep 10, 2019
@johnpapa johnpapa deleted the migrate-to-creators branch September 10, 2019 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants