title: How can I send items to a Kotlin.Flow (like a Behaviorsubject)
body: <p>I wanted to know how can I send/emit items to a <code>Kotlin.Flow</code>, so my use case is:</p>
  
  <p>In the consumer/ViewModel/Presenter I can <em>subscribe</em> with the <code>collect</code>  function:</p>
  
  <pre><code>fun observe() {
   coroutineScope.launch {
      // 1. Send event
      reopsitory.observe().collect {
        println(it)
      }
    }
  }
  </code></pre>
  
  <p>But the issue is in the <code>Repository</code> side, with RxJava we could use a <a href="http://reactivex.io/RxJava/javadoc/io/reactivex/subjects/BehaviorSubject.html" rel="noreferrer">Behaviorsubject</a> expose it as an <code>Observable/Flowable</code> and emit new items like this:</p>
  
  <pre><code>behaviourSubject.onNext(true)
  </code></pre>
  
  <p>But whenever I build a new flow:</p>
  
  <pre><code>flow {
  
  }
  </code></pre>
  
  <p>I can only <em>collect</em>. How can I send values to a flow?</p>