match msg with
                  
                  
                        | Reset -> 
                  
                  
                          let top, topCmd = Counter.init()
                  
                  
                          let bottom, bottomCmd = Counter.init()
                  
                  
                          { top = top
                  
                  
                            bottom = bottom }, 
                  
                  
                          Cmd.batch [ Cmd.map Top topCmd
                  
                  
                                      Cmd.map Bottom bottomCmd ]
                  
                  
                        | Top msg' ->
                  
                  
                          let res, cmd = Counter.update msg' model.top
                  
                  
                          { model with top = res }, Cmd.map Top cmd
                  
                  
                  
                  
                  
                        | Bottom msg' ->
                  
                  
                          let res, cmd = Counter.update msg' model.bottom
                  
                  
                          { model with bottom = res }, Cmd.map Bottom cmd
                  
                  
                  нах зачем тут делать эти мапы? без них тоже будет работать...
                  
                  
                
Не будет. Типы не сойдутся. :)
Обсуждают сегодня