Last active
June 15, 2017 07:21
-
-
Save hendrikswan/d6a29c39f00a4b3e86d48a03d185ac2c to your computer and use it in GitHub Desktop.
This file contains hidden or 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, going to try again'); | |
pendingItems.next(item); | |
}); | |
}); | |
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