Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Add support for Mobx enforceActions configuration #172

Merged

Conversation

johnrichter
Copy link
Contributor

Related to #170. Wraps observable field assignments with runInAction() to work in enforceActions: 'always' mode (and never/observed).

@coveralls
Copy link

coveralls commented Jun 12, 2019

Coverage Status

Coverage increased (+0.02%) to 99.07% when pulling 31d319d on johnrichter:170-EnforceActions-Always-Support into 069602f on mobxjs:master.

test/useAsObservableSource.test.tsx Show resolved Hide resolved
test/useLocalStore.test.tsx Outdated Show resolved Hide resolved
test/useLocalStore.test.tsx Outdated Show resolved Hide resolved
Simplify tests, remove unnecessary mocking of console, add new mobx test utils.
…perty updates for each Mobx enforceAction setting.
@johnrichter
Copy link
Contributor Author

@FredyC I added a bit of code to each test to ensure that updates to the observables also succeed in each enforceActions mode. This is in reference to: #170 (comment)

@iaroslavshvets
Copy link

Hi! I would appreciate if you could update this branch to current master, so it could be merged. It totally prevents from using useLocalStore. I forked this branch and updated to current master without any issues. I can create another updated pull request, but I see no point, as you did the job and the only thing missing - it's outdated.

@danielkcz danielkcz merged commit 776fb81 into mobxjs:master Jun 26, 2019
@johnrichter
Copy link
Contributor Author

Thanks for the update and merge @FredyC!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants