Created
June 15, 2017 06:50
-
-
Save hendrikswan/4904a10ea2ce87e316a661978c7b1367 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
const pendingItems = new Rx.Subject(); | |
pendingItems.subscribe((item) => { | |
api.syncEvent(item) | |
.then((result) => { | |
console.log('successfully synced a mouse event'); | |
}) | |
.catch((reason) => { | |
console.error('got an error while trying to sync an event') | |
}); | |
}); | |
function syncMouseEvent(event) { | |
pendingItems.next({ | |
x: event.clientX, | |
y: event.clientY | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment