@tum-far/ubii-interactions
v0.2.2
Published
Ubii interactions module.
Downloads
6
Readme
ubii interactions
This provides the Ubi-Interact module of Interactions as a relation of Cause(s) and Effect(s).
Description
Interactions are composed as a list of Causes and Effects. If any of the Causes are fulfilled all associated Effects will be triggered.
Causes/Effects are defined by any piece of code (Javascript for now) that can serve as the respective function. This function looks like:
function (input, state) { ... your code here ... }
(Cause)function (output, state) { ... your code here ... }
(Effect)
For Cause, if the body of this function returns true, it is counted as fulfilled.
- input (read-only): internal name for a variable that is mapped to outside topic data buffer.
- state (read-write): internal state of the Interaction instance.
- output (write-only): internal name for a variable that is mapped to outside topic data buffer.
This mapping of input/output to external topics needs to be defined for an instance of Interaction.
Testing
Run npm test
.