ochrons / scalajs-spa-tutorial

Tutorial for creating a simple Single Page Application in ScalaJS
Apache License 2.0
672 stars 230 forks source link

how to use an Observer pattern for query Server #37

Closed ranglang closed 8 years ago

ranglang commented 8 years ago

Aim's to querying the mongodb, how can i not use Blocking way for it.

 override def getPost(postId: String): Option[PostItem] ={
    ApiService.observableToRxObservable(postCollection.find(Filters.equal("_id",BsonObjectId(postId))))
      .map(doc => PostFormat.reads(doc)).toBlocking.headOption
  }

I will be grateful for any comment!

ochrons commented 8 years ago

This is not relevant for the SPA tutorial.