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

Add enforceActions support in ReactiveConfig and Derivations #87

Closed
pavanpodila opened this issue Feb 4, 2019 · 7 comments
Closed

Add enforceActions support in ReactiveConfig and Derivations #87

pavanpodila opened this issue Feb 4, 2019 · 7 comments
Assignees

Comments

@pavanpodila
Copy link
Member

Support the enforceActions feature of MobX JS

@pavanpodila pavanpodila self-assigned this Feb 5, 2019
@katis
Copy link
Contributor

katis commented Feb 6, 2019

I know that in Mobx JS enforced actions are disabled by default but I'd suggest that we enabled them by default, especially if we can get async @actions to work. This way making actions to mutate state would be the norm, and making state changes everywhere willy-nilly would be the hacky "quick&dirty" way.

@pavanpodila
Copy link
Member Author

pavanpodila commented Feb 6, 2019

Agree @katis, let me try that in the next PR. Have a bunch of tests that need to be changed as we are mutating lot of the observables outside actions.

More precisely, ~88 tests will fail 😬 if we enable EnforceActions.always as the default. Currently I have set it to EnforceActions.never

@katis
Copy link
Contributor

katis commented Feb 6, 2019

@pavanpodila What about using observed as the default? That's what I use in all my JS projects.

@pavanpodila
Copy link
Member Author

Ya, that would be good. Even there about 62 tests are failing

@pavanpodila
Copy link
Member Author

I can take it up once we merge this. Please review :-)

@katis
Copy link
Contributor

katis commented Feb 6, 2019

If enforceActions were changed to be variable in the context, you could just disable enforcement in the test files.

Edit: nvm, it already is configurable

@pavanpodila
Copy link
Member Author

Fixed in #88. Will open a separate issue for a stricter enforcement

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

No branches or pull requests

2 participants