-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Hej!
First of all, Im sorry for the out of place question; its more related to state machines, but given that workflows are such machines I still think this might be the best spot for it. I hope Im not wrong!
How do you deal with workflows that are editors?
If we go with a simple example like editing a number, its clear that the editor workflow renders something that allows editing the value, but where should the current value actually be stored? I think there are 2 alternatives?
-
When the editor workflow is initially rendered, the value is stored in its state as the current one, any edits to the value are stored in its state. When the editor is done, the value is emitted to the parent workflow and then cleared locally.
-
The input/props include the value, and every change emits an output with the new value, which the parent stores in its state.
How do you deal with this? Are there other alternatives? Ive personally leaned towards 2, but that includes more work for the parent workflow and reusability becomes more of a chore. Please enlighten me?