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

Add: revertable changes #181

Closed
dxinteractive opened this issue Feb 4, 2019 · 3 comments
Closed

Add: revertable changes #181

dxinteractive opened this issue Feb 4, 2019 · 3 comments

Comments

@dxinteractive
Copy link
Collaborator

dxinteractive commented Feb 4, 2019

async useParcelState + ability to revert changes in useParcelBuffer

ParcelBoundary can pass a reverter function into a change request, so that higher things like useParcelState can call that to tell useParcelBuffer to revert. Sounds loopy and inverted, but from useParcelBuffer's POV it's just another kind of trigger to change.

@dxinteractive dxinteractive changed the title Add: ParcelHoc buffer and ability to return promises from onChange() Add: ability to revert changes in a ParcelBoundary Feb 13, 2019
@dxinteractive dxinteractive changed the title Add: ability to revert changes in a ParcelBoundary Add: async ParcelHocs + ability to revert changes in a ParcelBoundary Mar 3, 2019
@dxinteractive
Copy link
Collaborator Author

Even better, promises should be able to be returned from useParcelState.onChange(), and if they reject then revert() can be called on the ChangeRequest. There can also be an additional param called something like updateFromOnChange which will set the parcel's value to the resolved value of the promise.

@dxinteractive dxinteractive changed the title Add: async ParcelHocs + ability to revert changes in a ParcelBoundary Add: async useParcelState + ability to revert changes in useParcelBuffer May 27, 2019
@dxinteractive dxinteractive changed the title Add: async useParcelState + ability to revert changes in useParcelBuffer Add: revertable changes May 27, 2019
@dxinteractive
Copy link
Collaborator Author

Also could make sense to set meta.onChangeState and meta.onChangeError

@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