You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can logically OR system events together with System.on(event1 | event2 | event3, handler);
To unregister a system handler, you can call System.off(handler) when you have previously called System.on(event1 | event2 | event3, handler); to unregister all events, or System.off(event3, handler); to unregister just event3
Note: event1,2,3 just temp names, refer to system events in docs for all available events.
The text was updated successfully, but these errors were encountered:
This might be pedantic but since the semantic meaning of on in System.on() (or "on occasion of") is not compatible with the semantic meaning of on as opposite of off the naming may seem confusing - if not abusing the language.
You can say "on occasion of" but "off occasion of" isn't the opposite 😎
When you hear System.off() it rather suggests to turn the System off where System.on() would do the same thing as powering the device - start it running.
An alternative might be System.ignore(event) and/or the introduction of an operator+= for System.on() (as known from e.g. C#) and its opposite operator-=.
https://github.com/particle-iot/firmware/blob/develop/wiring/inc/spark_wiring_system.h#L219-L241
You can logically OR system events together with
System.on(event1 | event2 | event3, handler);
To unregister a system handler, you can call
System.off(handler)
when you have previously calledSystem.on(event1 | event2 | event3, handler);
to unregister all events, orSystem.off(event3, handler);
to unregister just event3Note: event1,2,3 just temp names, refer to system events in docs for all available events.
The text was updated successfully, but these errors were encountered: