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
is non-null it means that we want to process that event lets
507
+
add it to our list of commands */
508
+
var cmd tea.Cmd
509
+
m.selector, cmd = m.selector.Update(msg)
510
+
cmds = append(cmds, cmd)
511
511
512
512
switch msg := msg.(type) {
513
513
/* ...all other events */
514
514
```
515
515
516
-
I like this pattern because it encapsulates all of the selector logic in one place. The downside is that you may be updating the child component unnecessarily (versus if you only called it forthe correct keystrokes). This isin my opinion a good tradeoff.
517
-
518
-
If the keypress triggers a command (like a selection) we return that command as well so that the event loop can restart.
516
+
I like this pattern because it encapsulates all of the selector logic in one place. The downside is that you may be calling the Update method unnecessarily (versus if you only called it forthe correct keystrokes). This isin my opinion a good tradeoff.
@@ -575,14 +573,12 @@ But the foundation for more complexity is now in place. Let's handle that next.
575
573
576
574
Let's add the following `case` our our `Update` method in our main model, which will handle the `selectMsg` message type when someone makes a selection.
0 commit comments