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

feat(router): router actions as ActionCreators #2206

Closed
timdeschryver opened this issue Nov 4, 2019 · 8 comments · Fixed by #2272
Closed

feat(router): router actions as ActionCreators #2206

timdeschryver opened this issue Nov 4, 2019 · 8 comments · Fixed by #2272
Assignees
Labels
Accepting PRs community watch Someone from the community is working this issue/PR Project: Router Store

Comments

@timdeschryver
Copy link
Member

If we're using the creator functions for reducers and effects we aren't able to use the router actions.
I'm suggesting that we'd also create these router actions as ActionCreators, for example:

export const routerRequestAction = createAction(ROUTER_REQUEST, props<{ payload: RouterRequestPayload<BaseRouterStoreState> }>())

Describe any alternatives/workarounds you're currently using

We can create the ActionCreators in our project.

Other information:

If accepted, I would be willing to submit a PR for this feature

[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

@maartentibau
Copy link
Contributor

OK, I will have a look on this tonight (if I don't forget), but I'm happy to help out on this one!

@timdeschryver timdeschryver added Accepting PRs community watch Someone from the community is working this issue/PR labels Nov 4, 2019
@Jefiozie
Copy link
Contributor

Hi @timdeschryver and @maartentibau, did one of you guys already worked on this?
I would like to help or pick up this ticket, however, I'm not exactly sure what I need to do.

My understanding of this ticket is that we would like to have migrated the default actions based on the new createAction ticket. Is this correct?

@timdeschryver
Copy link
Member Author

I'm not working on this.

We want to have both options (action type enum and action creator), familiar to #2219.

@Jefiozie
Copy link
Contributor

Okay, if @maartentibau doesn't mind I can have a look at this issue. ☺️

@maartentibau
Copy link
Contributor

@Jefiozie I don't mind if you have a look. I didn't really have a lot of time to look at it. But I'm certainly willing to help out if need be.

Sadly ... the time I can spend on OSS is very very limited these days, but since I'm using the creator methods now on a very frequent base I thought I could help out. But again... finding the time to do it is the hardest part.

So sure... feel free to start on it, thx m8!!

@Jefiozie
Copy link
Contributor

So I added a draft PR, should we update the docs (https://ngrx.io/guide/router-store/actions) as well?

@timdeschryver
Copy link
Member Author

I think we should, we're going to make the creator functions the default in v9.x so I think it will be helpful to add it to the docs.

I think we should update the docs with the emphasis on the creator function, and add a note that the action types can still be used.
Similar to actions/reducers/effects in the current docs:

image

@Jefiozie
Copy link
Contributor

I missed your comment for some reason, I will make some changes to the docs in upcoming days. Did you have some time to see if the PR is what you expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepting PRs community watch Someone from the community is working this issue/PR Project: Router Store
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants