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

Simplify updater #287

Merged
merged 18 commits into from Mar 10, 2020
Merged

Conversation

dxinteractive
Copy link
Collaborator

@dxinteractive dxinteractive commented Mar 7, 2020

Addresses #284, #285

dataparcels

  • BREAKING CHANGE modifiers passed to parcel.update(), parcel.modifyUp and parcel.modifyDown now always pass entire parcel data (not just value) and expect either undefined or an object optionally containing value and meta. The meta is shallowly merged into existing meta.
  • BREAKING CHANGE parcel.modifyUp() now passes changeRequest key on first param, not as second param
    • parcel.modifyUp((value, changeRequest) => {}) becomes parcel.modifyUp(({value, changeRequest}) => {})
  • BREAKING CHANGE removed asRaw, as this is now the default behaviour of all updaters
  • BREAKING CHANGE removed asNode, because normal updaters cover all its uses now
  • BREAKING CHANGE removed parcelNode.setMeta, because parcelNode.update can now do the same thing
  • BREAKING CHANGE removed parcel.spy() and parcel.spyChange()
    • use parcel.modifyDown(({value}) => { /* side effect */ }) and parcel.modifyUp(({changeRequest}) => { /* side effect */ }) instead, returning nothing
  • Added createUpdater() to allow people to create and compose their own updater functions
  • Fix: parcel.update() now rebases correctly, passing new data through the updater, instead of retaining the result of the first execution as it did before V2 - make update() perform an "update" and not a "setData" #285

react-dataparcels

  • BREAKING CHANGE useParcelState() no longer allows value function to be used as an updater
  • BREAKING CHANGE removed all deprecated components (ParcelHoc, ParcelBoundaryHoc)

@dxinteractive dxinteractive changed the title WIP feature/simplify updater Simplify updater Mar 7, 2020
@dxinteractive dxinteractive merged commit 27e1ae1 into release/strict-swift Mar 10, 2020
@dxinteractive dxinteractive deleted the feature/simplify-updater branch March 10, 2020 00:49
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.

None yet

2 participants