easy-peasy
easy-peasy copied to clipboard
feat: Lazy models [WIP]
following the approach detailed https://github.com/ctrlplusb/easy-peasy/issues/410
Added
- useStoreModel hook
- Store.Model wrapper component for a declarative approach
TODO Tests
Possible issues the usage of this new API on context stores might give some headaches if my proposal for runtime injections for context stores gets eventually merged, need to think about that...
@ctrlplusb
- Should this be available on context stores aswell?
- Backwards compatibility with V3 so no need to wait for 4.0 :)
Codecov Report
Merging #412 into master will decrease coverage by
1.66%. The diff coverage is41.17%.
@@ Coverage Diff @@
## master #412 +/- ##
==========================================
- Coverage 97.87% 96.21% -1.67%
==========================================
Files 20 21 +1
Lines 566 581 +15
Branches 105 105
==========================================
+ Hits 554 559 +5
- Misses 10 20 +10
Partials 2 2
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/create-context-store.js | 100% <ø> (ø) |
:arrow_up: |
| src/index.js | 100% <100%> (ø) |
:arrow_up: |
| src/store.js | 33.33% <33.33%> (ø) |
|
| src/hooks.js | 82.08% <38.46%> (-10.64%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update ca71036...fd99492. Read the comment docs.
@ctrlplusb hey again, going to pick this up soon as well, anything you would like to discuss regarding the proposal?
Let's wait till after the next major release before tackling this.
I believe it can be bolted on as a minor version. I need the dust to settle so we can get through this next big release.
I'm closing this, as I want to avoid adding additional complexity to this library right now as I don't have the capacity to maintain it regularly.