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
Having to connect each component manually is tiresome. Consider this example: 2 textinputs are the children to a container component, I would like to pass in the value to each input as a pointer to a rune slice, and have the state "held" by the parent.
I've devised a somewhat working example in which textinputs emit a message whenever they update any part of their state that might be shared. The message is called "sharedStateUpdated". Other components can listen to this event and "refresh" accordingly. It doesn't seem to affect performance.
This simplifies the parent's Update method drastically, since no explicit wiring between the children is needed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Having to connect each component manually is tiresome. Consider this example: 2 textinputs are the children to a container component, I would like to pass in the value to each input as a pointer to a rune slice, and have the state "held" by the parent.
I've devised a somewhat working example in which textinputs emit a message whenever they update any part of their state that might be shared. The message is called "sharedStateUpdated". Other components can listen to this event and "refresh" accordingly. It doesn't seem to affect performance.
This simplifies the parent's Update method drastically, since no explicit wiring between the children is needed.
Thank you for working on this wonderful library.
Beta Was this translation helpful? Give feedback.
All reactions