
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 elx
import {elx} from 'elx'
// a counter in 4 lines
elx('button', 0)
.fromDOMEvent('click', 1)
.reduce((state, received) => state + received)
.subscribe((el, state) => el.textContent = state)
Every element has its initial state.
// for the counter example
const initialState = 0
const source = elx('button', initialState)
Notify your element with some data, of course it does not know how to handle the data for now.
source.fromDOMEvent('click', 1)
Sure the event handler can be a function or even a Promise that resolves the data.
source.fromDOMEvent('click', () => {
return new Promise(resolve => setTimeout(() => {
resolve(1)
}, 1000))
})
Abosolutely you can use custom actions, because you need cross-element communications!
source.fromAction('INCREMENT', 1)
If you are using custom action, you can use source.dispatch(ACTION) to trigger that action! Action names are all caps.
Tell your element how to get the new state after received data from event hander.
// since it's just a counter
// we simply add the received data in event handler
// to the currentState
const reducer = (currentState, received) => currentState + received
source.reduce(reducer)
Trigger when element's state got changed.
source.subscribe((el, newState) => {
el.textContent = newState
})
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featureFAQs
State management for a single dom element.
We found that elx 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.