![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@pixi/runner
Advanced tools
Readme
A simple alternative to events and signals with an emphasis on performance.
Can be used as an alternative to events / signals.
npm install @pixi/runner
import { Runner } from '@pixi/runner';
const onComplete = new Runner('onComplete');
// listenerObject needs to have a 'onComplete' function
onComplete.add(listenerObject);
// emit() and all listeners will have their 'onComplete' functions called
onComplete.emit(data);
Can be used to execute a function on many objects. Handy for games. If you need to update you game elements each frame:
import { Runner } from '@pixi/runner';
const updateRunner = new Runner('update');
// gameItems should all have a 'update' function
updateRunner.add(gameItem1);
updateRunner.add(gameItem2);
updateRunner.add(gameItem3);
// Update game elements...
updateRunner.emit();
Pros:
Cons:
In practice I have found the Runner incredibly useful and so thought it would be nice to share with the world. It currently forms the backbone of the messaging system in our game engine. Its working out great for things like update events, collision events etc.
Great to use if you are say looping through and array and calling the same function on each object. The resulting code is cleaner than a loop whilst still keeping the performance as fast as possible.
So yeah, if you are dispatching signals/events to a lot of listeners often (like everyframe often), then I would consider using this alternative. For most cases, this performance boost is not really important enough to switch from your current fave.
Think of this as a nice alternative for when speed really counts!
to run the tests, move to the runner-benchmark folder then run the following:
npm run benchmark
Next open you browser (http://localhost:9966). The test is run in the console. The test result above comes from macbook pro chrome 58.
Any thoughts or comments hit me up on twitter @doormat23, I'd love to hear them!
FAQs
A simple alternative to events and signals with an emphasis on performance.
The npm package @pixi/runner receives a total of 83,439 weekly downloads. As such, @pixi/runner popularity was classified as popular.
We found that @pixi/runner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.