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 a shortCircuitSwitch operator #61

Open
codemile opened this issue Jan 10, 2020 · 1 comment
Open

add a shortCircuitSwitch operator #61

codemile opened this issue Jan 10, 2020 · 1 comment
Milestone

Comments

@codemile
Copy link
Collaborator

This is an operator that adds caching to an observable stream.

shortCircuitSwitch<T>(key: (v: T) => string | number, ob$: Observable<T>);

When a value is emitted the operator will use the key returned by the callback to see if here is a cached value internally (this might be a passed in reference). If there is no value the observable is switchMap() and the value from that is cached. Otherwise the cached value is emitted.

I'm not sure of all the edge cases for this.

@codemile codemile added this to the 3.0.0 milestone Jan 10, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.93. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

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