Having trouble calling RxJS share using the recommended operator import
问题 I'm trying to understand the best practice for importing rxjs operators It seems like I should import share this way, but, the following doesn't work because it says share expects 0 arguments. I'm not quite sure how to call share correctly. import { share } from 'rxjs/operators'; ... public currentUser: Observable<User> = share(this.currentUser$.asObservable()); Doing it the old way causes no problems. However I seemed to have read that's not the preferred way to import https://www.learnrxjs