
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
kea-listeners
Advanced tools
Listners plugin for kea. Works with kea 1.0.0-rc.4 and up.
Listeners are functions that run after an action is dispatched.
They have built in support for cancellation if needed.
Add the package:
yarn add kea-listeners
... then add it to kea's plugins list:
import listeners from 'kea-listener'
resetContext({
plugins: [listeners]
})
kea({
// ...
listeners: ({ actions, values, store, sharedListeners }) => ({
// action that conditionally calls another action
[actions.openUrl]: ({ url }) => {
// get the value from the reducer 'url'
const currentUrl = values.url
if (url !== currentUrl) {
actions.reallyOpenTheUrl(url)
}
},
// listen to any redux action type, not just ones defined in this logic
'LOCATION_CHANGE': (payload) => {
// do something with the regular redux action
console.log(payload)
store.dispatch({
type: 'REDUX_ACTION',
payload: { redux: 'cool' }
})
},
// two listeners with one shared action
[actions.anotherAction]: sharedListeners.sharedActionListener,
[actions.yetAnotherAction]: sharedListeners.sharedActionListener,
// Debounce for 300ms before making an API call
// Break if this action was called again while we were sleeping
[actions.debouncedFetchResults]: async ({ username }, breapoint) => {
// If the same action gets called again while this waits, we will throw an exception
// and catch it immediately, effectively cancelling the operation.
await breakpoint(300)
// Make an API call
const user = await API.fetchUser(username)
// if during the previous fetch this action was called again, then break here
breakpoint()
// save the result
actions.userReceived(user)
},
// you can also pass an array of functions
[actions.oneActionMultipleListeners]: [
(payload, breakpoint, action) => { /* ... */ },
sharedListeners.doSomething,
sharedListeners.logAction
]
}),
// if multiple actions must trigger similar code, use sharedListeners
sharedListeners: ({ actions, values, store }) => ({
// all listeners and sharedListeners also get a third parameter:
// - action = the full dispatched action
sharedActionListener: function (payload, breakpoint, action) {
if (action.type === actions.anotherAction.toString()) {
// handle this case separately
}
// do something common for both
console.log(action)
}
})
})
FAQs
Action Listener side-effects for Kea
We found that kea-listeners 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.