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

@pixi/runner

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/runner

A simple alternative to events and signals with an emphasis on performance.

  • 5.3.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @pixi/runner?

@pixi/runner is a utility package for the PixiJS library that provides a mechanism to manage and execute a series of functions (runners) in a specific order. It is particularly useful for managing events and callbacks in a structured and efficient manner.

What are @pixi/runner's main functionalities?

Creating a Runner

This feature allows you to create a new Runner instance. The 'onEvent' string is the name of the event that the runner will manage.

const { Runner } = require('@pixi/runner');
const myRunner = new Runner('onEvent');

Adding Functions to a Runner

You can add multiple functions (callbacks) to a runner. These functions will be executed in the order they were added when the runner is triggered.

function callback1() { console.log('Callback 1 executed'); }
function callback2() { console.log('Callback 2 executed'); }
myRunner.add(callback1);
myRunner.add(callback2);

Executing a Runner

This feature allows you to execute all the functions added to the runner in the order they were added. In this example, 'Callback 1 executed' and 'Callback 2 executed' will be logged to the console.

myRunner.emit();

Removing Functions from a Runner

You can remove specific functions from the runner. After removal, the function will no longer be executed when the runner is triggered.

myRunner.remove(callback1);

Other packages similar to @pixi/runner

Keywords

FAQs

Package last updated on 21 Dec 2020

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