1.3.1 • Published 7 months ago

lesca-enterframe v1.3.1

Weekly downloads
5
License
MIT
Repository
-
Last release
7 months ago

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
1.3.1

7 months ago

1.3.0

8 months ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.2

2 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago