Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
redux-beacon
Advanced tools
Analytics integration for Redux and ngrx/store
npm install --save redux-beacon
Redux Beacon maps redux/ngrx actions to analytics events then sends them to a target (e.g. Google Analytics).
Analytics events are defined in an event definition, and mapped to actions in an event definitions map:
// This is an event definition
const pageView = (action, prevState) => ({
hitType: 'pageview',
page: action.payload,
referrer: prevState.route,
});
// This is another event definition
const buttonClick = action => ({
hitType: 'event',
eventCategory: 'button-click',
eventAction: action.type,
});
// This is how you map event definitions to redux/ngrx actions
const eventsMap = {
LOCATION_CHANGED: pageView,
BUTTON_CLICKED: buttonClick,
}
With the set up above Redux Beacon will create pageView
, and buttonClick
events whenever redux/ngrx dispatches LOCATION_CHANGED
or BUTTON_CLICKED
,
then it'll push the generated analytics events to a target (e.g. Google
Analytics).
Redux Beacon provides extensions to help handle intermittent outages in connectivity. These extensions place events in a persistent store when offline (e.g indexedDB). When back online, the extensions purge the store and pass the events off to a target. Read more about offline event collection in the docs.
Check out the project site for API docs, tutorials, examples and more.
FAQs
Analytics integration for Redux and ngrx/store
The npm package redux-beacon receives a total of 32,233 weekly downloads. As such, redux-beacon popularity was classified as popular.
We found that redux-beacon 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.