New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@khanacademy/wonder-blocks-timing

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@khanacademy/wonder-blocks-timing - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

46

docs.md

@@ -176,4 +176,3 @@ Abstractions for common timing APIs like `setTimeout`, `setInterval` and

period: number,
autoSchedule?: boolean,
resolveOnClear?: boolean,
options?: Options,
): ITimeout;

@@ -189,4 +188,3 @@ ```

| `period` | `number` | _Required_ | The timeout period in milliseconds. The action will be invoked after this period has passed since the timeout was set. This value must be greater than or equal to zero. |
| `autoSchedule` | `boolean` | `true` | Whether or not to set the timeout as soon as this call is made, or wait until `set` is explicitly called. Defaults to `true`. |
| `resolveOnClear` | `boolean` | `false` | Whether or not the associated action will be invoked if it is still pending at the point the timeout is cleared. Defaults to `false`. This only takes effect when the [clearAll](#clearall) is invoked on parent the `IScheduleActions` instance, such as when unmounting; this does not affect calls to the `clear` method on the returned `ITimeout` interface. |
| `options` | `Options` | `{schedulePolicy: SchedulePolicy.Immediately, clearPolicy: ClearPolicy.Cancel}` | Options to control various aspects of the timeout such as whether it starts immediately or not, and whether the scheduled action is invoked on clear or not. The clear policy only takes effect when the [clearAll](#clearall) is invoked on parent the `IScheduleActions` instance, such as when unmounting; this does not affect calls to the `clear` method on the returned `ITimeout` interface. For more on policies, see [Policies](#policies). |
| _returns_ | [`ITimeout`](#itimeout) | | An interface for manipulating the created timeout. |

@@ -200,4 +198,3 @@

period: number,
autoSchedule?: boolean,
resolveOnClear?: boolean,
options?: Options,
): IInterval;

@@ -213,4 +210,3 @@ ```

| `period` | `number` | _Required_ | The interval period in milliseconds. The action will be invoked each time this period has passed since the interval was set or last occurred. This value must be greater than zero. |
| `autoSchedule` | `boolean` | `true` | Whether or not to set the interval as soon as this call is made, or wait until `set` is explicitly called. Defaults to `true`. |
| `resolveOnClear` | `boolean` | `false` | Whether or not the associated action will be invoked at the point the interval is cleared if the interval is running at that time. Defaults to `false`. This only takes effect when the [clearAll](#clearall) is invoked on parent the `IScheduleActions` instance, such as when unmounting; this does not affect calls to the `clear` method on the returned `IInterval` interface. |
| `options` | `Options` | `{schedulePolicy: SchedulePolicy.Immediately, clearPolicy: ClearPolicy.Cancel}` | Options to control various aspects of the interval such as whether it starts immediately or not, and whether the scheduled action is invoked on clear or not. The clear policy only takes effect when the [clearAll](#clearall) is invoked on parent the `IScheduleActions` instance, such as when unmounting; this does not affect calls to the `clear` method on the returned `IInterval` interface. For more on policies, see [Policies](#policies). |
| _returns_ | [`IInterval`](#iinterval) | | An interface for manipulating the created interval. |

@@ -223,4 +219,3 @@

action: () => void,
autoSchedule?: boolean,
resolveOnClear?: boolean,
options?: Options,
): IAnimationFrame;

@@ -235,4 +230,3 @@ ```

| `action` | `()` `=>` `void` | _Required_ | The action to be invoked before the repaint. |
| `autoSchedule` | `boolean` | `true` | Whether or not to make the request as soon as this call is made, or wait until `set` is explicitly called. Defaults to `true`. |
| `resolveOnClear` | `boolean` | `false` | Whether or not the associated action will be invoked at the point the request is cleared if it has not yet executed. Defaults to `false`. This only takes effect when the [clearAll](#clearall) is invoked on parent the `IScheduleActions` instance, such as when unmounting; this does not affect calls to the `clear` method on the returned `IAnimationFrame` interface. |
| `options` | `Options` | `{schedulePolicy: SchedulePolicy.Immediately, clearPolicy: ClearPolicy.Cancel}` | Options to control various aspects of the animation frame such as whether it starts immediately or not, and whether the scheduled action is invoked on clear or not. The clear policy only takes effect when the [clearAll](#clearall) is invoked on parent the `IScheduleActions` instance, such as when unmounting; this does not affect calls to the `clear` method on the returned `IAnimationFrame` interface. For more on policies, see [Policies](#policies). |
| _returns_ | [`IAnimationFrame`](#ianimationframe) | | An interface for manipulating the created request. |

@@ -250,2 +244,18 @@

##### Policies
###### SchedulePolicy
| Policy | Value | Description |
| --- | --- | --- |
| `OnDemand` | `"schedule-on-demand"` | The scheduled action's timing will begin when `set` is called. |
| `Immediately` | `"schedule-immediately"` | The scheduled action's timing will begin immediately. |
###### ClearPolicy
| Policy | Value | Description |
| --- | --- | --- |
| `Cancel` | `"cancel-on-clear"` | The action, if set at the time of applying the policy, will be cancelled without being invoked. |
| `Resolve` | `"resolve-on-clear"` | The action, if set at the time of applying the policy, will be invoked as if the scheduled time had occurred. |
##### ITimeout

@@ -257,3 +267,3 @@

set(): void;
clear(resolve?: boolean): void;
clear(clearPolicy?: ClearPolicy = ClearPolicies.Cancel): void;
}

@@ -268,3 +278,3 @@ ```

| `set` | `()` `=>` `void` | If the timeout is pending, this cancels that pending timeout and starts the timeout afresh. If the timeout is not pending, this starts the timeout. Can be used to re-schedule an already invoked or cleared timeout. |
| `clear` | `(resolve?:` `boolean)` `=>` `void` | If the timeout is pending, this cancels that pending timeout. If no timeout is pending, this does nothing. When the optional `resolve` argument is `true`, and the timeout was in the set state when called, the timeout action is invoked after cancelling the timeout. The `resolve` parameter defaults to `false`. This call does nothing if there was no pending timeout (i.e. when `isSet` is `false`). |
| `clear` | `(clearPolicy?:` `ClearPolicy)` `=>` `void` | If the timeout is pending, this cancels that pending timeout. If no timeout is pending, this does nothing. When the optional `clearPolicy` argument is `ClearPolicy.Resolve`, and the timeout was in the set state when called, the timeout action is invoked after cancelling the timeout. The `clearPolicy` parameter defaults to `ClearPolicy.Cancel`. This call does nothing if there was no pending timeout (i.e. when `isSet` is `false`). |

@@ -277,3 +287,3 @@ ##### IInterval

set(): void;
clear(resolve?: boolean): void;
clear(clearPolicy?: ClearPolicy = ClearPolicies.Cancel): void;
}

@@ -288,3 +298,3 @@ ```

| `set` | `()` `=>` `void` | If the interval is active, this cancels that interval and restarts it afresh. If the interval is not active, this starts the interval. Can be used to re-schedule a cleared interval. |
| `clear` | `(resolve?:` `boolean)` `=>` `void` | If the interval is active, this cancels that interval. If the interval is not active, this does nothing. When the optional `resolve` argument is `true`, and the interval was in the active state when called, the associated action is invoked after cancelling the interval. The `resolve` parameter defaults to `false`. This call does nothing if there was no pending interval (i.e. when `isSet` is `false`). |
| `clear` | `(clearPolicy?:` `ClearPolicy)` `=>` `void` | If the interval is active, this cancels that interval. If the interval is not active, this does nothing. When the optional `clearPolicy` argument is `ClearPolicy.Resolve`, and the interval was in the active state when called, the associated action is invoked after cancelling the interval. The `clearPolicy` parameter defaults to `ClearPolicy.Cancel`. This call does nothing if there was no active interval (i.e. when `isSet` is `false`). |

@@ -297,3 +307,3 @@ ##### IAnimationFrame

set(): void;
clear(resolve?: boolean): void;
clear(clearPolicy?: ClearPolicy = ClearPolicies.Cancel): void;
}

@@ -308,3 +318,3 @@ ```

| `set` | `()` `=>` `void` | If the request is pending, this cancels that pending request and starts a request afresh. If the request is not pending, this starts the request. Can be used to re-request an already invokd or cleared request. |
| `clear` | `(resolve?:` `boolean)` `=>` `void` | If the request is pending, this cancels that pending request. If no request is pending, this does nothing. When the optional `resolve` argument is `true`, and the request was in the active state when called, the associated action is invoked after cancelling the request. The `resolve` parameter defaults to `false`. This call does nothing if there was no pending request (i.e. when `isSet` is `false`). |
| `clear` | `(clearPolicy?:` `ClearPolicy)` `=>` `void` | If the request is pending, this cancels that pending request. If no request is pending, this does nothing. When the optional `clearPolicy` argument is `ClearPolicy.Resolve`, and the request was in the set state when called, the associated action is invoked after cancelling the requst. The `clearPolicy` parameter defaults to `ClearPolicy.Cancel`. This call does nothing if there was no pending request (i.e. when `isSet` is `false`). |

@@ -311,0 +321,0 @@ ### Migration from standard API

{
"name": "@khanacademy/wonder-blocks-timing",
"private": false,
"version": "2.0.1",
"version": "2.0.2",
"design": "v1",

@@ -17,3 +17,3 @@ "publishConfig": {

"peerDependencies": {
"react": "^16.4.1"
"react": "16.14.0"
},

@@ -25,3 +25,3 @@ "devDependencies": {

"license": "MIT",
"gitHead": "9a9cc04bf2bbfb425f991a347b4f8b0d0d56e120"
"gitHead": "b6193f70c73e70fbaf76bc688dc69a47fb1d0ef3"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc