Skip to content

Commit 0887c46

Browse files
committed
fix(Controller): add throwDisposed calls where needed
1 parent 27e154e commit 0887c46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/Controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export class Controller<State extends Lookup = Lookup>
172172

173173
/** Freeze the active animation in time */
174174
pause(keys?: OneOrMore<string>) {
175+
throwDisposed(this.is(DISPOSED))
175176
if (is.und(keys)) {
176177
if (!this.is(PAUSED)) {
177178
this._phase = PAUSED
@@ -187,6 +188,7 @@ export class Controller<State extends Lookup = Lookup>
187188

188189
/** Resume the animation if paused. */
189190
resume(keys?: OneOrMore<string>) {
191+
throwDisposed(this.is(DISPOSED))
190192
if (is.und(keys)) {
191193
if (this.is(PAUSED)) {
192194
this._phase = this._active.size ? ACTIVE : IDLE
@@ -218,6 +220,7 @@ export class Controller<State extends Lookup = Lookup>
218220
this._phase = DISPOSED
219221
stopAsync(this._state)
220222
this.each(spring => spring.dispose())
223+
overrideGet(this, 'queue', throwDisposed)
221224
overrideGet(this, 'springs', throwDisposed)
222225
}
223226
}

0 commit comments

Comments
 (0)