cartant / rxjs-tslint-rules

TSLint rules for RxJS
https://cartant.github.io/rxjs-tslint-rules/
MIT License
371 stars 22 forks source link

shareReplay is forbidden unless a config argument is passed #127

Open sonikasharma1403 opened 2 years ago

sonikasharma1403 commented 2 years ago

const SHARE_REPLAY_CONFIG = { bufferSize: 1, refCount: true }; observable.pipe(shareReplay(SHARE_REPLAY_CONFIG))

I am using a constant variable and then passing it to the shareReplay operator. If we do this, lint throws shareReplay is forbidden unless a config argument is passed. Replacing the variable with the object fixes the issues. shouldn't the type be infered?