Stumbled upon this code:
const { operator } = this;
from https://github.com/ReactiveX/rxjs/blob/master/src/Observable.ts#L89
What does it mean?
Stumbled upon this code:
const { operator } = this;
from https://github.com/ReactiveX/rxjs/blob/master/src/Observable.ts#L89
What does it mean?
It's object destructuring. This
const { operator, other } = this;
is equivalent to
const operator = this.operator;
const other = this.other;
It's borrowed from ES6, which has the same feature.
const operator = this.operator;?this, you will need to write mutiple lines about fetch. Thereforce, ES6 offers destructuring is easy to write in one line.