
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
flux-dispatcherasync
Advanced tools
Async flux dispatcher with promises
Works as the original dispatcher, except when the callback returns a promise.
When a promise is returned the flow will wait for the resolve of the promise to continue. The waitfor for the promise should be called outside the depending callback as the waitfor does not wait by itself. Best is to register a so called main callback, which checks for dependencies for the payload and calls the appropriate waitfor(s).
import {Dispatcher} from "flux";
import "./lib/dispatcherAsync";
const dispatcher = new Dispatcher();
//see code example https://facebook.github.io/flux/docs/dispatcher/ for more information.
//general dispatcher needs to be registered first
dispatcher.register(function (payload) {
switch (payload.actionType) {
case "SaveClient":
dispatcher.waitFor([Client.dispatchToken]);
//and continue ...
}
});
Client.dispatchToken = dispatcher.register(function(payload) {
if (payload.actionType === 'FetchClient') {
return new Promise((resolve, reject) => {
//do some logic and resolve
resolve();
});
}
});
FAQs
Async flux dispatcher with promises
The npm package flux-dispatcherasync receives a total of 0 weekly downloads. As such, flux-dispatcherasync popularity was classified as not popular.
We found that flux-dispatcherasync 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.