anchor.diff:  val newFriend = "Karl Heinrich Marx"
   // This hypothetical service method adds friend
   // to the user friend list and returns Future[Unit]
  -userService.addFriend(user.id, newFriend) map { _ =>
  -  transition { case state @ Authorized(_, user) =>
  +userService.addFriend(user.id, newFriend) flatMap { _ =>
  +  access.transition { case state @ Authorized(_, user) =>
       state.copy(user = user.copy(user.friends :+ newFriend))
     }
   }
   --------------------------------------------------------------
   
  -`Transition` is a type alias for `PartialFunction[S, S]` where `S` is the type of your state.
  +`Transition` is a type alias for `S => S` where `S` is the type of your state.
   
   Events
   ~~~~~~
  
positive.code:       'button("Submit")
      )
    ),
    eventWithAccess('submit) { access =>
      deferredTransition {
        access
          .downloadFormData(myForm)
          .onProgress { (loaded, total) =>
            transition { ... }
          }
          .start()
          .map { formData =>
            transition { ... }
          }
      }
    }
  )
  -----------------------------------
  
  Use `onProgress` callback to handle progress of the form downloading. Function `start` return a `FormData`. Look API documentation for more details.
  
  https://github.com/fomkin/korolev/blob/v0.5.2/examples/form-data/src/main/scala/FormDataExample.scala[See full example]
  
  Delays
  ~~~~~~
  
negative.code: 
  val render: Render = {
    case true => 'body(
      delay(3.seconds) { access =>
        access.transition(_ => false)
      },
      "Wait 3 seconds!"
    )
    case false => 'body(
      'button(
        event('click) { access =>
          access.transition(_ => true)
        },
        "Push the button"
      )
  