easy-peasy icon indicating copy to clipboard operation
easy-peasy copied to clipboard

feat: Lazy models [WIP]

Open kamikazePT opened this issue 5 years ago • 3 comments

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 :)

kamikazePT avatar Jan 23 '20 23:01 kamikazePT

Codecov Report

Merging #412 into master will decrease coverage by 1.66%. The diff coverage is 41.17%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update ca71036...fd99492. Read the comment docs.

codecov[bot] avatar Jan 23 '20 23:01 codecov[bot]

@ctrlplusb hey again, going to pick this up soon as well, anything you would like to discuss regarding the proposal?

kamikazePT avatar Sep 07 '20 13:09 kamikazePT

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.

ctrlplusb avatar Sep 24 '20 04:09 ctrlplusb

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.

ctrlplusb avatar Sep 15 '22 07:09 ctrlplusb