dx-platform icon indicating copy to clipboard operation
dx-platform copied to clipboard

Add Behavior type

Open raveclassic opened this issue 4 years ago • 0 comments

Add the following type to rx-utils

interface Behavior<A> extends Observable<A> {
  readonly getValue: () => A;
}

so that we could use it as both a value-over-time and an Observable.

Also add typeclass instance (you can use rxjs's internal _subscribe method to deal with Observable#subscribe which cannot be overridden due to messy overloadings):

export const instance: Functor<URI> & FoldableValue<URI>  = { ... } 
export const behavior = {
  ...instance,
  ...pipeable(instance)
}

raveclassic avatar Jun 01 '20 13:06 raveclassic