Created
March 6, 2021 15:51
-
-
Save tomaspietravallo/64389a94fccc854174623dc4019dba47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Made by Tomás Pietravallo for Diego Aguirre & The Spark AR Community | |
// Import modules | |
import Patches from 'Patches'; | |
// Import Typescript types | |
import { BoolSignal } from 'ReactiveModule'; | |
(async function () { | |
// await is used to get & resolve the getBoolean() promise | |
const input1: BoolSignal = await Patches.outputs.getBoolean('InputBool1'); | |
const input2: BoolSignal = await Patches.outputs.getBoolean('InputBool2'); | |
// or() is the Reactive funtion for the boolean operator OR (commonly denoted with || ) | |
// onOn() creates an event every time the OR operation switches from false -> true. | |
// Patches.inputs.setPulse() returns a pulse to the patch editor | |
Patches.inputs.setPulse('OutputPulse1', input1.or(input2).onOn()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment