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

@gladeye/af

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gladeye/af

Animation Frame class & instance with read and write cycles to maximise performance

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

AF

Simple animation frame class with read and write cycles to seperate out logic and draws to improve performance.

Reads will run before Writes.

Installation

npm install @gladeye/af

Use

As a singleton. This should be the main way this is used.

import { af } from '@gladeye/af'; // lowercase af

let count = 0;

function update(){
    count ++;
}

const animFram = af();

animFram.addRead( update );

animFramf.removeRead( update );

Or you may extend the class.

import { AF } from '@gladeye/af'; // uppercase AF

class ewAF extends AF{

}

Methods

- start()

- stop()

- addRead( fn )
    Adds function to the read cycle. These will run before the write functions

- addWrite( fn )
    Adds function to the write cycle. These will run after the read functions

- removeRead( fn )
    Removes function from the read cycle

- removeWrite( fn )
    Removes function from the write cycle

- onNextRead( fn )
    Adds function to run once on the next read cycle

- onNextWrite( fn )
    Adds function to run once on the next write cycle

FAQs

Package last updated on 11 Oct 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc