Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
api:event [2017/07/20 07:06]
payonel [Functions]
api:event [2019/06/01 19:13]
everyos [Functions]
Line 20: Line 20:
 **event** - name of the signal to listen to.\\ **event** - name of the signal to listen to.\\
 **callback** - the function to call if this signal is received. The function will receive the event name it was registered for as first parameter, then all remaining parameters as defined by the [[component:​signals|signal]] that caused the event.\\ **callback** - the function to call if this signal is received. The function will receive the event name it was registered for as first parameter, then all remaining parameters as defined by the [[component:​signals|signal]] that caused the event.\\
-**Returns:​** `true` if the event was successfully registered, `false` if this function was already registered for this event type.+**Returns:​** `number`, the event id which can be canceled via `event.cancel`, ​if the event was successfully registered, `false` if this function was already registered for this event type.
 - `event.ignore(event:​ string, callback: function): boolean`  ​ - `event.ignore(event:​ string, callback: function): boolean`  ​
 Unregister a previously registered event listener.  ​ Unregister a previously registered event listener.  ​
Line 78: Line 78:
  
 - `event.pullMultiple(...):​ ...` (Since 1.5.9) - `event.pullMultiple(...):​ ...` (Since 1.5.9)
-As its arguments `pullMutliple` accepts multiple event names to be pulled, allowing basic filtering of multiple events at once.+As its arguments `pullMultiple` accepts multiple event names to be pulled, allowing basic filtering of multiple events at once.
 - `event.onError(message:​ any)`  ​ - `event.onError(message:​ any)`  ​
 Global event callback error handler. If an event listener throws an error, we handle it in this function to avoid it bubbling into unrelated code (that only triggered the execution by calling `event.pull`). Per default, this logs errors into a file on the temporary file system.  ​ Global event callback error handler. If an event listener throws an error, we handle it in this function to avoid it bubbling into unrelated code (that only triggered the execution by calling `event.pull`). Per default, this logs errors into a file on the temporary file system.  ​