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(Effects, Example): add createEffect #1667

Merged
merged 2 commits into from
Apr 1, 2019
Merged

Conversation

timdeschryver
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #1368

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 30, 2019

Preview docs changes for 47991c3 at https://previews.ngrx.io/pr1667-47991c3/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 30, 2019

Preview docs changes for 6671dbf at https://previews.ngrx.io/pr1667-6671dbf/

@timdeschryver timdeschryver changed the title feat(Effect, Example): add createEffect feat(Effects, Example): add createEffect Mar 30, 2019
@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 30, 2019

Preview docs changes for 36a4eeb at https://previews.ngrx.io/pr1667-36a4eeb/

1 similar comment
@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 30, 2019

Preview docs changes for 36a4eeb at https://previews.ngrx.io/pr1667-36a4eeb/

@brandonroberts brandonroberts merged commit ced2d3d into master Apr 1, 2019
@brandonroberts brandonroberts deleted the pr/create-effect branch April 1, 2019 13:38
const CREATE_EFFECT_METADATA_KEY = '__@ngrx/effects_create__';

export function createEffect<T extends Action>(
source: (() => Observable<T>),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be Observable for the dispatch false? We shouldn't force it to be an Action for dispatch: false.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had it first as a non action but it seemed a bit weird to me while changing the example-app,
because the non-dispatching effects were all taps on the actions stream.

But now that you mention it, I do agree. It would make an effect harder to implement on a non-actions stream.

What do you think @brandonroberts ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree also. I thought the same, but I didn't mention it in the review 😞

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.

RFC: Introduce new "effect" function as an alternative/replacement for the @Effect() decorator
4 participants