Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Behavior type #223

Open
raveclassic opened this issue Jun 1, 2020 · 0 comments
Open

Add Behavior type #223

raveclassic opened this issue Jun 1, 2020 · 0 comments

Comments

@raveclassic
Copy link
Contributor

raveclassic commented Jun 1, 2020

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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant