diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
| commit | d55b767039605256c736166a942a9138e3eacfd7 (patch) | |
| tree | 947063b634c50d438a794325f13275e134aa5993 /node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts | |
| parent | 864ce67d89c77d8ef9c3361f80d619853abcf91c (diff) | |
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts')
| -rw-r--r-- | node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts b/node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts deleted file mode 100644 index 502bbc7..0000000 --- a/node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { AsyncAction } from './AsyncAction'; -import { AnimationFrameScheduler } from './AnimationFrameScheduler'; -import { SchedulerAction } from '../types'; -import { animationFrameProvider } from './animationFrameProvider'; -import { TimerHandle } from './timerHandle'; - -export class AnimationFrameAction<T> extends AsyncAction<T> { - constructor(protected scheduler: AnimationFrameScheduler, protected work: (this: SchedulerAction<T>, state?: T) => void) { - super(scheduler, work); - } - - protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle { - // If delay is greater than 0, request as an async action. - if (delay !== null && delay > 0) { - return super.requestAsyncId(scheduler, id, delay); - } - // Push the action to the end of the scheduler queue. - scheduler.actions.push(this); - // If an animation frame has already been requested, don't request another - // one. If an animation frame hasn't been requested yet, request one. Return - // the current animation frame request id. - return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined))); - } - - protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle | undefined { - // If delay exists and is greater than 0, or if the delay is null (the - // action wasn't rescheduled) but was originally scheduled as an async - // action, then recycle as an async action. - if (delay != null ? delay > 0 : this.delay > 0) { - return super.recycleAsyncId(scheduler, id, delay); - } - // If the scheduler queue has no remaining actions with the same async id, - // cancel the requested animation frame and set the scheduled flag to - // undefined so the next AnimationFrameAction will request its own. - const { actions } = scheduler; - if (id != null && id === scheduler._scheduled && actions[actions.length - 1]?.id !== id) { - animationFrameProvider.cancelAnimationFrame(id as number); - scheduler._scheduled = undefined; - } - // Return undefined so the action knows to request a new async id if it's rescheduled. - return undefined; - } -} |
