We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have just figured out a way to use memoizee for RxJS:
import { Observable } from 'rxjs'; import { publishReplay, refCount } from 'rxjs/operators'; import * as memoizee from 'memoizee'; type ObservableFunction = <T>(args: any[]) => Observable<T>; export function memoizeObservable(toWrap: ObservableFunction, options: memoizee.Options) { const newOptions = Object.assign({}, options); return memoizee(function(this: any, ...args: any[]) { const result$ = toWrap.apply(this, args); return result$.pipe(publishReplay(1)).pipe(refCount()); }, newOptions); }
Is there a chance you're going to support this out of the box or would you rather see a library "memoizee-rxjs" or something along these lines?
Anyway - sharing this snippet here in case somebody finds it useful.
The text was updated successfully, but these errors were encountered:
@Rush can you reedit your message, so example is in plain JavaScript? Otherwise it's hard for me to relate to it.
Sorry, something went wrong.
Will do
Rush
No branches or pull requests
I have just figured out a way to use memoizee for RxJS:
Is there a chance you're going to support this out of the box or would you rather see a library "memoizee-rxjs" or something along these lines?
Anyway - sharing this snippet here in case somebody finds it useful.
The text was updated successfully, but these errors were encountered: