Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

framesync

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

framesync - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

CHANGELOG.md

2

package.json
{
"name": "framesync",
"version": "2.0.0",
"version": "2.0.1",
"description": "A tiny frame scheduler for performantly batching reads and renders",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -1,4 +0,4 @@

# framesync
# Framesync
A tiny frame scheduler for performantly batching reads and renders.
A tiny frame scheduler for performantly batching reads and renders. Segregating actions that read and write to the DOM will avoid [layout thrashing](https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing).

@@ -12,1 +12,40 @@ ## Install

## Usage
The Framesync render loop executes four sequential steps, once per frame.
- `frameStart`
- `frameUpdate`
- `frameRender`
- `frameEnd`
Developers can set any function to run at any of these steps using the `on` and `cancel` callbacks:
- `onFrameStart`, `cancelOnFrameStart`
- `onFrameUpdate`, `cancelOnFrameUpdate`
- `onFrameRender`, `cancelOnFrameRender`
- `onFrameEnd`, `cancelOnFrameEnd`
`timeSinceLastFrame` and `currentFrameTimestamp` methods provide frame-locked time measurements.
### Example
```javascript
import {
timeSinceLastFrame,
onFrameStart,
cancelFrameStart
} from 'popmotion';
function logTimeSinceLastFrame() {
console.log(timeSinceLastFrame());
onFrameStart(logTimeSinceLastFrame);
}
onFrameStart(logTimeSinceLastFrame);
function stopLogging() {
cancelOnFrameStart(logTimeSinceLastFrame);
}
setTimeout(stopLogging, 5000);
```
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