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

fix(effects): add support for Proxy objects in Effects #2976

Merged
merged 3 commits into from
Mar 23, 2021
Merged

fix(effects): add support for Proxy objects in Effects #2976

merged 3 commits into from
Mar 23, 2021

Conversation

MortenGregersen
Copy link
Contributor

@MortenGregersen MortenGregersen commented Mar 16, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] 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?

Right now mergeEffects fails with an error when a Proxy object is injected in an Effects class.

Closes #2975

What is the new behavior?

With this extra condition Proxy will be filtered out.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

I don't fully understand how the commit message should be formed and if there should be any documentation changes. I hope you can help with that.

@MortenGregersen MortenGregersen changed the title Proxy support in effects Support for Proxy objects in Effects Mar 16, 2021
@ngrxbot
Copy link
Collaborator

ngrxbot commented Mar 16, 2021

Preview docs changes for 62030b5 at https://previews.ngrx.io/pr2976-62030b5a/

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

LGTM, I just would like to add a comment on why the extra check is needed, because this is an edge case.

A bit out of scope but do you have an example of a capacitor plugin that is used as an Effect?

@MortenGregersen
Copy link
Contributor Author

MortenGregersen commented Mar 22, 2021

LGTM, I just would like to add a comment on why the extra check is needed, because this is an edge case.

I've added a comment 👍🏻

A bit out of scope but do you have an example of a capacitor plugin that is used as an Effect?

I don't have a public example using a Capacitor plugin. But the reproduction code for the related issue has an example of the use case we want to fix with this pull request. The Proxy object behaves the same way as Capacitor's plugins.
https://github.com/MortenGregersen/ngrx-proxy/blob/main/src/app/app.module.ts

I have created a related issue on Capacitor's repository, as I think they also should look into this.
ionic-team/capacitor#4356

@brandonroberts brandonroberts changed the title Support for Proxy objects in Effects fix(effects): add support for Proxy objects in Effects Mar 22, 2021
@timdeschryver timdeschryver merged commit 5f5b679 into ngrx:master Mar 23, 2021
@MortenGregersen MortenGregersen deleted the proxy-support-in-effects branch March 23, 2021 08:14
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.

Error when injecting Proxy object in effect class
4 participants