anchor.diff:           Stream.MVar.updateFun modelMVar
             <| Map.add (Id.next ()) {IsCompleted = false; Header = header})
   
  +      // Filtering predicates on ToDo items.
         let isAny _ = true
         let isCompleted item = item.IsCompleted
         let isActive item = item.IsCompleted |> not
   
  +      // This stream holds the chosen ToDo item filter.  This stream is
  +      // constructed so that it starts with one initial element and then
  +      // subsequent elements are generated in response to GUI filter button
  +      // clicks.  This stream also updates the GUI as a side-effect.
         let filter =
           let filterOn (button: Button) pred =
             Stream.ofObservableOnMain button.Click
  
positive.code:               |> main.Items.Children.Add
                |> ignore) })
  
        Stream.MVar.tap modelMVar
        |> Stream.keepPreceding1
        |> Stream.subscribeJob (fun model -> onMain {
           let n = Map.toSeq model |> Seq.filter (snd >> isActive) |> Seq.length
           main.NumberOfItems.Text <- sprintf "%d items left" n })
  
        Stream.MVar.tap modelMVar
        |> Stream.keepPreceding1
        |> Stream.subscribeJob (fun model -> onMain {
  
negative.code:            control.Remove.Visibility <-
               if 0 < n then Visibility.Visible else Visibility.Hidden })
  
          // This removes the item from the model if the Remove button is clicked.
          Stream.ofObservableOnMain control.Remove.Click
          |> Stream.subscribeJob (fun _ ->
             Stream.MVar.updateFun modelMVar <| Map.remove id)
  
          control
  
        // This renders the visible list of ToDo items.  All controls are
        // recreated.  Consider the use of `keepPreceding1`.  In this example it
        // doesn't really make any difference, but if it would be possible to make
        // updates to the model faster than it would be possible to render the
        // GUI, then it would basically avoid queuing GUI updates and make sure
        // that, once finally updated, the GUI would show the latest state.
        // Contrast this with Rx style throttling using some arbitrary millisecond
        // timeout.
        Stream.MVar.tap modelMVar
        |> Stream.combineLatest filter
        |> Stream.keepPreceding1
  