Created
March 15, 2018 05:15
-
-
Save d4rekanguok/95749dafe5ecddc3eac1bf1784b210ea 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
Layer::chain = (options...) -> | |
layer = @ | |
options.reduce (promise, option) -> | |
promise.then () -> | |
new Promise (resolve) -> | |
layer.animate option | |
layer.once Events.AnimationEnd, () -> | |
resolve() | |
, Promise.resolve() | |
box = new Layer | |
backgroundColor: 'blue' | |
box.chain {backgroundColor: 'red'}, | |
{x: 100}, | |
{y: 200, backgroundColor: 'blue'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment