code: function view(state$) {
      // Displayed for each chat message.
      function chatMessage(msg) {
        return li('.message', { key: msg.id }, [
          img({
            height: '50', width: '50',
            src: `http://api.adorable.io/avatars/50/${msg.authorId}.png`,
          }),
          span('.text', msg.text),
        ])
      }
  
      return state$.map(
        state =>
          div([
            div('.row',
                ul(state.messages.map(chatMessage))),
            div('#input.row',
                input('.u-full-width', { value: state.inputValue, autoFocus: true })),
          ])
      )
    }
docs: View takes the state and create a stream of virtual-dom trees for the app.