anchor.diff:  Device and Session
   ~~~~~~~~~~~~~~~~~~
   
  -When user opens your application first time, Korolev sets a cookie named `device` with the unique identifier. After that you can identify the user by deviceId. Note that every new browser will receive a new `deviceId`.
  -
  -Session is created when user opens a page. Every session has unique indentifer. Korolev creates a State for every session.
  +When a user opens your application first time, Korolev sets a cookie named `device` with the unique identifier. After that, you can identify the user by deviceId. Note that every new browser will receive a new `deviceId`.
  +
  +A session is created when the user opens a page. Every session has the unique identifier. Korolev creates a State for every session.
   
   State
   ~~~~~
  
positive.code: 
  2. Immutable and pure. Really, we don't need mutability even on the frontend. Especially on the frontend. The majority of modern JavaScript frameworks are trying to be functional. And so are we.
  
  3. Lack of dependencies. Korolev do not impose to use cats, scalaz, akka or futures from standard library. Use what you want. Korolev tries to give a way integrate itself to any environment.
  
  Understanding Korolev
  ---------------------
  
negative.code: 
  Routing
  ~~~~~~~
  Router allow to use integrate browser navigation in you app. In the router you define bidirectional mapping between the state and url.
  
  Let's our application is a blog platform
  [source,scala]
  -------------------------------------------------------------------------------
  case class MyState(author: String, title: String, text: String)
  
  // Converts "The Cow: Saga" to "the-cow-saga"
  def captionToUrl(s: String) = ???
  
  KorolevServiceConfig(
    ...
    // Render the article
    render = {
      case MyState(author, title, text) => 'body(
        'div(s"$author: $title"),
        'div(text)
      )
    },
    serverRouter = ServerRouter(
      // Static router works when user enters
      // with any url but "/".
      static = (deviceId) => Router(
        toState = {
          case (_, Root / author / article) => articleServrice.load(author, article)
          case _ => articleServrice.defaultArticle
        }
      ),
      dynamic = (device, session) => Router(
        fromState = {
          case MyState(tab, _) =>
            Root / tab.toLowerCase
        },
        toState = {
          case (s, Root) =>
            val u = s.copy(selectedTab = s.todos.keys.head)
            Future.successful(u)
          case (s, Root / name) =>
            val key = s.todos.keys.find(_.toLowerCase == name)
            Future.successful(key.fold(s)(k => s.copy(selectedTab = k)))
        }
      )
    )
  )
  -------------------------------------------------------------------------------
  
  Design patterns
  ---------------
  