Syntax for passing {} objects to typescript functions
by TheIndependentAquarius from LinuxQuestions.org on (#5BA1V)
https://rxjs-dev.firebaseapp.com/guide/observable
Code:observable.subscribe({
next(x) { console.log('got value ' + x); },
error(err) { console.error('something wrong occurred: ' + err); },
complete() { console.log('done'); } });As I can see they have passed functions to {} object and then passed this object as a parameter to function subscribe.
What is the function syntax for this kind of parameter accepting functions?
Does this actually mean that we are passing an object which has definitions of functions inside it as a function parameter?
Please point out the documentation.


Code:observable.subscribe({
next(x) { console.log('got value ' + x); },
error(err) { console.error('something wrong occurred: ' + err); },
complete() { console.log('done'); } });As I can see they have passed functions to {} object and then passed this object as a parameter to function subscribe.
What is the function syntax for this kind of parameter accepting functions?
Does this actually mean that we are passing an object which has definitions of functions inside it as a function parameter?
Please point out the documentation.