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

Updater arguments #188

Closed
dxinteractive opened this issue Feb 15, 2019 · 1 comment
Closed

Updater arguments #188

dxinteractive opened this issue Feb 15, 2019 · 1 comment

Comments

@dxinteractive
Copy link
Collaborator

  • Remove Parcel as second argument
  • Add ChangeRequest as second argument to modifyUp updater
  • Pass through ChangeRequest as second argument to shape if it exists

Adding ChangeRequest isn't as simple as it may seem. modifyUp updaters can be called during a change propagation or afterward, and with different data after the ChangeRequest has finished propagating, as this allows the entire rebasing feature to work. Change Requests are immutable and largely stateless (apart from based parcel data, that enables prevData and nextData to work), so as long as the stateful data is blatted and refreshed before using it, a reference to the current ChangeRequest can be safely passed into the propagating ChangeRequest's _addPost(into itself!). Effectively attaching a snapshot of the change request to the post function. Then the reducer will need to give any change requests attached to post actions updated data, so that prevData and nextData will be correct everytime and not just by chance. ChangeRequests will then need to be able to be based onto ParcelData as well as Parcel instances. This is because the reducer has no knowledge of Parcel instances, and also does not need to cope with stale local data due to non-updating React components, which is the only reason that ChangeRequests are based onto Parcels and not ParcelData currently.

New actions can no longer be created mid-propagation so that's no longer a concern.

@dxinteractive dxinteractive changed the title Updater tweaks Updater arguments Feb 15, 2019
@dxinteractive
Copy link
Collaborator Author

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

No branches or pull requests

1 participant