docs: function intent(sources) {
      const horizonCollection = sources.horizon(sources.config.collectionName)
      // Every time the enter key is hit in the text box
      const enterHit$ = sources.DOM
              .select('#input')
              .events('keydown')
              .filter(ev => ev.keyCode === 13)
              .map(ev => ev.target.value || null)
              .share()
      // Every time the text in the input box changes
      const inputChange$ = sources.DOM
              .select('#input')
              .events('input')
              .map(ev => ev.target.value)
      // all our chats from the horizon server
      const messages$ = horizonCollection
              .order('datetime', 'descending')
              .limit(sources.config.chatLength)
              .watch()
  
      // Every time the user hits enter, store the message to the server
      // Note: this is an observable of observables
      const writeOps$$ = enterHit$.map(text =>
        horizonCollection.store({
          authorId: sources.config.authorId,
          datetime: new Date(),
          text,
        })
      )
  
      // This merges the stream of the input values with a stream that
      // returns null whenever enter is hit. This will clear the text
      // box after submitting.
      const inputValue$ = inputChange$.merge(enterHit$.map(() => null))
      return {
        inputValue$,
        writeOps$$,
        messages$,
      }
    }