Socket
Socket
Sign inDemoInstall

lesca-enterframe

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lesca-enterframe

get delta for each frame


Version published
Weekly downloads
80
increased by247.83%
Maintainers
1
Install size
304 kB
Created
Weekly downloads
 

Readme

Source

React React React React React NPM React NPM

Why use it?

Use it calculator timestamp for animation.

Live Demo

Installation

npm install lesca-enterframe --save

Usage

As a Node module:

import { useState, useEffect } from 'react';
import EnterFrame from 'lesca-enterframe';

const Component = () => {
  const [time, setTime] = useState(0);

  useEffect(() => {
    EnterFrame.add((e) => {
      const { delta } = e;
      setTime(delta);
    });
  }, []);

  return (
    <div>
      <h1>{time}</h1>
      <button onClick={() => EnterFrame.play()}>Play</button>
      <button onClick={() => EnterFrame.stop()}>Stop</button>
    </div>
  );
};

Development

Methods

methoddescriptionreturn
.add(frame:function)extend call funcvoid
.play()continue calling funcvoid
.stop()stop calling funcvoid
.undo()reverse to last functionvoid
.destroy()remove eventvoid
.setFPS(fps:number)set FPSvoid
.reset(fps:number)reset deltavoid

Properties

Propertiestypedescriptiondefault
todoObjectget function and list of function history[]

Features

  • maintain if necessary

Keywords

FAQs

Last updated on 17 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc