
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
npm install --save event-flow
Event Flow is a declarative syntax for expressing how data moves through functions.
store.subscribe function behaves..call( ... ) which simply calls the given function, and 2) the other is defined by .pipe( ... ).to( ... ), which calls the pipe function with the to function. The advantage of approach #2 is that you can generalize how data flows to the to function. The pipe may choose to call it once, never, many times, after a Promise is resolved, etc... depending on the event arguments. And, the logic of how data flows to the to function is decoupled from the function itself. For example, you could call to with Redux store.dispatch if you're piping actions.createEvent(event)event is a function of a function, e.g. Redux store.subscribe.EventFlow class.EventFlow are composable, meaning that they all return this.)EventFlow.pass(source)source is a function called at event time. Its return value is passed as an argument to each event delegate. If pass is called multiple times, then multiple arguments will be passed in the order of the calls.this.EventFlow.call(delegate)delegate is a function called at event time with arguments.this.EventFlow.pipe(delegate)delegate is a function called at event time with a "yield" function, plus arguments. delegate may asynchronously call the "yield" function, which is defined by the next call to EventFlow.to.this.EventFlow.to(yield_function)pipe delegate, which is defined by the previous call to EventFlow.pipe.this.import { createEvent } from 'event-flow';
import { createStore } from 'redux';
const store = createStore((state = 0, action) => {
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'RESET':
return 0;
default:
return state;
}
});
const actions = (push, state) => {
if (state === 10) {
push({ type: 'RESET' });
setTimeout(() => push({ type: 'RESET' }), 500);
}
};
// Create a simple event flow that dispatches actions after a change to state (and logs the state).
createEvent(store.subscribe)
.pass(store.getState)
.call(state => console.log(`state = ${state}`))
.pipe(actions).to(store.dispatch);
// Dispatch INCREMENT actions every 100ms.
setInterval(() => store.dispatch({ type: 'INCREMENT' }), 100);
Console output:
state = 1
state = 2
state = 3
state = 4
state = 5
state = 6
state = 7
state = 8
state = 9
state = 10
state = 0
state = 1
state = 2
state = 3
state = 4
state = 0
state = 1
state = 2
state = 3
state = 4
state = 5
state = 6
state = 7
state = 8
state = 9
state = 10
state = 0
state = 1
state = 2
state = 3
state = 4
state = 0
state = 1
state = 2
state = 3
state = 4
state = 5
state = 6
state = 7
state = 8
state = 9
state = 10
state = 0
etc...
FAQs
Event Flow: Functional JavaScript event plumbing
We found that event-flow 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.