![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
causeeffect
Advanced tools
Created to simplify flow management when programming in asynchronous environments like nodejs.
CauseEffect extends EventEmitter and allows to set cause-effect scenarios.
It is simple yet effective.
CauseEffect allows you to:
* have an event fired when multiple parallel flows complete.
* easily unite multiple parallel flows initiated from the for loop.
* set up chains: completion of one rule may trigger another.
* set the rules dynamically or statically.
* have an event fired when any of the flows completes.
To run example:
node examples/sample.js
Installation: npm install causeeffect
Usage: To setup a rule where an event will fire if all of the causes happen: ce.setEvents("myevent", ["cause1", "cause2", "cause3"]);
To setup a rule where an event will fire if some of the causes happen:
ce.setEvents("myevent", ["cause1", "cause2", "cause3"], true);
To setup a rule where an event will fire if it happens X times:
ce.setEvents("myevent", 10);
Listen to effect event as usual with EventEmitter API:
ce.on("myevent", callback);
To let CauseEffect know that the cause has happened call:
ce.setState("cause1");
or if you need a specific value use
ce.setState("cause1", value);
This value can be then obtained from your event callback with:
ce.getState("cause1")
To run example:
node examples/sample.js
Sample:
Uniting multiple parallel flows initiated from the for loop: var ce = require('causeeffect'); ce = new ce.CauseEffect();
// Set up ticker cause. Event "myticker" will fire if ce.setState("myticker") was invoked 4 times. // Handy for figuring out when all callbacks have been called initiated from the for loop. ce.setEvents("myticker", 4);
function callback() { ce.setState("myticker"); }
for(var i = 0; i< 4; i++) { setTimeout(callback, 100); }
ce.on("myticker", function() { });
Uniting specific parallel flows // Set up AND cause effect. Event "alldone" will be fired if all of causes happen ce.setEvents("alldone", ["cause1", "cause2", "myticker"]);
// Listen to event as usual with EventEmitter API ce.on("alldone", function() { });
// To let CauseEffect know that the cause has happened ce.setState("cause1"); ce.setState("cause2");
FAQs
Evented rules for nodejs - flow management simplified
The npm package causeeffect receives a total of 22 weekly downloads. As such, causeeffect popularity was classified as not popular.
We found that causeeffect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.