You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially, the reducer would specify events to bind to and a corresponding function that gets the last value, event emitted and returns the new value. Here's how fullName could be built without a getter (and #434 merged) :
The functions should be called with the last value and all arguments used to dispatch the event. This makes it possible to have a funciton like (last, event, newValue, oldValue) => {}.
Should "deep" values be supported? For example reduce: { "task.length": ()=>{} }.
How should the set values be treated? Perhaps a reserved name?
I'd like something like the following to work:
Essentially, the reducer would specify events to bind to and a corresponding function that gets the last value, event emitted and returns the new value. Here's how
fullName
could be built without agetter
(and #434 merged) :Notes / Questions
The functions should be called with the last value and all arguments used to dispatch the event. This makes it possible to have a funciton like
(last, event, newValue, oldValue) => {}
.Should "deep" values be supported? For example
reduce: { "task.length": ()=>{} }
.How should the set values be treated? Perhaps a reserved name?
Could a
get
be used as a "final" stage and avoid intermediate steps?Can these "reducers" be shared and tested somehow? Or would we need
can-reducer
for this?How to build this
We can add a reducer observable that would work like:
This can be mixed in similar to how
ResolverObservable
is here:can-define/can-define.js
Line 455 in 10d9068
ReducerObservable
would be a constructor function very similar in API toResolverObservable
, with the right symbols:The text was updated successfully, but these errors were encountered: