-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR for #21 #31
PR for #21 #31
Conversation
PR to get fork up to date
PR to update branch
src/between.js
Outdated
@@ -15,9 +15,10 @@ const _requestAnimationFrame = ( // polyfill | |||
|| raf | |||
); | |||
|
|||
let _prevTime = Date.now(), _time, _delta; | |||
let _prevTime = Date.now(), _time, _delta, _paused; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't _paused
stop all loops instead of just one? @hirako2000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it was i thought one instance per tween... why would they share state?
I think, if that's the case, one instance per tween would be preferable, furthermore, should move away from Date.now()
to some sort of Loop /timer
instance instance, for finer grained control. (thinks backward action and timelapse value on each tween)
Yes, we can replace Date.now() with delta a second argument - then it would
work
…On Wed, Aug 8, 2018 at 1:39 AM Hirako ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/between.js
<#31 (comment)>:
> @@ -15,9 +15,10 @@ const _requestAnimationFrame = ( // polyfill
|| raf
);
-let _prevTime = Date.now(), _time, _delta;
+let _prevTime = Date.now(), _time, _delta, _paused;
yes it would i thought one instance per tween... why would they share
state?
I think, if that's the case, one instance per tween would be preferable,
furthermore, should move away from Date.now()l to some sort of Loop /timerinstance
instance, for finer grained control.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHTX1a-2tBr7JP3QInd2Regua_iZ86zKks5uOhcmgaJpZM4Vx0Rk>
.
|
… use Symbol for the paused flag , and replace function with proper getter sasha240100#21
return this; | ||
} | ||
|
||
get isPaused() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added getter instead of function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirako2000 Nice!
@@ -9,6 +9,7 @@ const _betweens = []; | |||
const SYMBOL_TYPE = Symbol('type'); | |||
const SYMBOL_START_TIME = Symbol('start_time'); | |||
const SYMBOL_COMPLETED = Symbol('completed'); | |||
const SYMBOL_PAUSED = Symbol('paused'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using symbol now.
thanks for pointing that out. |
return this; | ||
} | ||
|
||
get isPaused() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirako2000 Nice!
types/between-tests.ts
Outdated
@@ -22,7 +22,7 @@ between.on('complete', (value) => { value }); | |||
// Test pause control | |||
between.pause(); | |||
between.start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hirako2000 How about renaming .start()
to .run()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I called it start
because the emitted event that was already present is called start
. It's for consistency.
But up to you, I can rename if you think it's better.
We better name it “play” * as it will continue paused tween
…On Wed, Aug 8, 2018 at 5:03 PM Hirako ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In types/between-tests.ts
<#31 (comment)>:
> @@ -22,7 +22,7 @@ between.on('complete', (value) => { value });
// Test pause control
between.pause();
between.start();
I called it start because the emitted event that was already present is
called start. It's for consistency.
But up to you, I can rename if you think it's better.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHTX1cnErHxn5ZG32l44A1-XjLGvmmrWks5uOu-egaJpZM4Vx0Rk>
.
|
Renamed |
Adds pause functionality and update first example to demo it