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
I'm attempting to use flyd to build a state management system. The application state comprises of smaller states that can be subscribed to, and a combined state (using a combined stream) that can also be subscribed to as a whole. I would like a way to pass metadata from the independent stream to the dependent stream when a new value is emitted.
Perhaps you could in your library do something like:
conststream=(...args)=>{consts=flyd.stream(...args);s.metadata=flyd.stream();// pretend we received an updates.metadata.map(()=>s(s()));returns;}// ... laterconstcombined=combine((v1,v2)=>{constmetadata={...v1.metadata(), ...v2.metadata()};console.log('data',v1());console.log('data',v2());console.log('meta',metadata);},[s1,s2])
Maybe you could enforce usage of the streams as a Tuple
I'm attempting to use flyd to build a state management system. The application state comprises of smaller states that can be subscribed to, and a combined state (using a combined stream) that can also be subscribed to as a whole. I would like a way to pass metadata from the independent stream to the dependent stream when a new value is emitted.
I imagine the API looking something like this:
If there is already a workflow that provides this functionality, could you tell me about it?
The text was updated successfully, but these errors were encountered: