Sawtaytoes
9/30/2018 - 5:51 AM

Redux Observable Timer

An example implementation of Redux-Observable's timer observable.

const timer = (
  timeToWait,
) => (
  Observable
  .create(observer => (
    setTimeout(
      () => {
        observer.next(0)
        observer.complete()
      },
      timeToWait,
    )
  )
)