Skip to content

Instantly share code, notes, and snippets.

@heypiotr
Last active July 6, 2017 09:16
Show Gist options
  • Select an option

  • Save heypiotr/3ab1af4813f451cf52591ece4179d1bc to your computer and use it in GitHub Desktop.

Select an option

Save heypiotr/3ab1af4813f451cf52591ece4179d1bc to your computer and use it in GitHub Desktop.
mirror.setScanFilter({types: ["nearable"]});
mirror.listen(Mirror.Events.SCAN, {
onscan: (event) => {
let nearable = event.devices[0];
if (nearable && nearable.motion == true) {
document.getElementById("placeholder").innerText = "I like to move it";
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment