-
Notifications
You must be signed in to change notification settings - Fork 0
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: Allow for functions as actions #105
Comments
Rewrite
|
|
Lets not do this if possible. It makes it much harder to serialise change requests (important if these are to be saved in local storage or something), and most use cases I can think of right now would be taken care of by an |
This actually has many advantages than previously thought. It removes the need for This means Also an |
This is necessary for proper safe
update
andmodifyChange
functions, and may end up simplifying the reducer a bunch.Previously kind of hard to make in a way that could still have replayable actions on different data sets.
func
.modify
s that happen. Concat those functions and their keypaths and pass into child parcels. Send this array of modifiers in each action.func
action is sent, the reducer can start from its own source of parcelData, and it can run nested data through the array of modifiers where necessary to end up with the same data that the action-ing parcel has at the time it send its action. This means thefunc
function can then be called with that data, and the result can be applied to the locationed indicated by thefunc
actions keypath as per normal.What about
modifyChange
?Needs more thought, but I think these can be done in essentially the same way. The order of action could be:
parcelData
at allShould these be separate actions, or somehow appended to origin actions so you can never get in that weird middle state of unrepresentative data?
The text was updated successfully, but these errors were encountered: