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.io/concepts/operator-imports.html
import 'rxjs/add/operator/share';
...
public currentUser: Observable<User> = this.currentUser$.asObservable().share();
How should I call share if I'm using the recommended way of importing?