I don't achieve to get any information about () => {}
An example in Meteor:
Meteor.startup(() => {
// code to run on server at startup
});
What is its function?
Thank you so much.
I don't achieve to get any information about () => {}
An example in Meteor:
Meteor.startup(() => {
// code to run on server at startup
});
What is its function?
Thank you so much.
That is ES6 short hand for an anonymous function definition in javascript.
Short hand for:
Meteor.startup(function() {
});
Specifically in this case, it's a callback that is invoked once the startup method for Meteor is run.
The benefit with using =>
is that this
is bound at the appropriate scope.