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

Refactor lastOriginId and add mergeMode #230

Merged
merged 11 commits into from
Jul 15, 2019

Conversation

dxinteractive
Copy link
Collaborator

@dxinteractive dxinteractive commented Jun 20, 2019

dataparcels

  • Refactor to remove _lastOriginId, replace with more generic frameMeta
    • frameMetas job is to hold data that should only exist until the next change occurs (the current parcel frame). lastOriginId requires that same data lifespan.
    • lastOriginId was a concept that only react-dataparcels was interested in, and probably shouldnt have been put in plain dataparcels
  • Fix issue where change requests's cache wasn't bieng reset by dispatch() when it should
  • No breaking changes

react-dataparcels

  • refactor to use frameMeta to set and get lastOriginId
  • refactor that added ability for useParcelBuffer (and therefore useParcelForm) to rebase changes when frameMeta.mergeMode === "rebase"
    • This will be used by rekey to rebase changerequests onto values that have updated
    • Not part of public API yet
  • No breaking changes

frameMetas job is to hold data that should only exist
until the next change occurs (the current parcel frame)

lastOriginId requires that same data lifespan

lastOriginId was a concept that only react-dataparcels
was interested in, and probably shouldnt have been put
in plain dataparcels
replacing the inner parcel from props is intended to be a complete reset,
so the buffer should also be emptied
when no rebasing and new data is received from props, buffer is wiped and buffers state is replaced with data from props
when rebasing and new data is received from props, buffers state is replaced with data from props with buffer applied to it
also fixed a wrong test that was relying on incorrect cachebehaviour in a change request
@dxinteractive dxinteractive changed the title Refactor lastOriginId Refactor lastOriginId and add mergeMode Jul 14, 2019
@dxinteractive dxinteractive merged commit afddc35 into release/scientific-salamander Jul 15, 2019
@dxinteractive dxinteractive deleted the feature/merge-mode branch July 15, 2019 06:51
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