All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.laminext.fetch.ops.EventStreamOfFetchResponseOps.scala Maven / Gradle / Ivy

There is a newer version: 0.17.0
Show newest version
package io.laminext.fetch.ops

import com.raquo.laminar.api.L._
import io.laminext.fetch.FetchResponse

class EventStreamOfFetchResponseOps[A](underlying: EventStream[FetchResponse[A]]) {

  def mapData[B](project: A => B): EventStream[B] =
    underlying.map(r => project(r.data))

  def data: EventStream[A] =
    underlying.map(_.data)

  def okay: EventStream[Boolean] =
    underlying.map(_.ok)

  def status: EventStream[Int] =
    underlying.map(_.status)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy