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
import{createStore,combine,createEvent}from'effector';consthandleSendMessage=createEvent();consteditMessage=createEvent();const$messageInputFieldText=createStore('');const$message=createStore({text: 'hello'});const$editingMessage=createStore();const$editingMessage.on(editMessage,(_,message)=>message);split({source: [$editingMessage,$messageInputFieldText],clock: handleSendMessage,match: ([editingMessage])=>editingMessage ? 'updateMessage' : 'appendPendingChatMessage',cases: {updateMessage: ([editingMessage,messageInputFieldText])=>{console.log(`Updating message ${editingMessage.id} with text ${messageInputFieldText}`);},appendPendingChatMessage: ([,messageInputFieldText])=>{console.log(`creating new message with text ${messageInputFieldText}`);},},});editMessage($message.getState());handleSendMessage();
This throws an error,
source must be a unit
Any way to get this to work or waiting until/if split starts supporting an array of units?
The text was updated successfully, but these errors were encountered:
Suppose the following:
This throws an error,
Any way to get this to work or waiting until/if
split
starts supporting an array of units?The text was updated successfully, but these errors were encountered: