There's something I'm not sure to understand with ES6 modules, especially when it comes to import with side effects.
For example, in an Angular project, I'm using Rxjs library to use observables. I need to import functions and objects from this library with ES6 import.
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
//later in the code I'm using these imports like this in a method
return Obserable.of(....);
My problem is with imports : import { Observable } from 'rxjs/Observable'; seems understandable: I'm importing Observable object from 'rxjs/Obserable' located in node_modules.
My problem is with import 'rxjs/add/observable/of'; Why not something like import { of } from 'rxjs/....';
I've read import '...' doesn't export any object or function. What does it do exactly ? If you are not exporting 'of' operator, how can you use it ? When to use import */import {} from or directly import '...';
Thanks