This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@klarna/redux-simple-analytics

0.0.3 • Public • Published

redux-simple-analytics

Simple analytics middleware for Redux.

Usage

Unlike redux-analytics, redux-simple-analytics doesn't require a meta key in your actions and it also doesn't enforce FSA actions through isFSA.

Therefore, all you have to do is to create your regular actions:

// constanst.js
export const MY_ACTION = 'MY_ACTION'

// actions.js
const action = {
  type: MY_ACTION
}

Then, write the middleware to handle your analytics tracking:

/* global ga /
import constants from './constants'
import analytics from 'redux-simple-analytics'

const middleware = analytics(({ type, payload }, state) => {
  switch(type){
  case MY_ACTION:
    ga('send', 'whatever', 'you', 'want');
    break
  }
})

Contributing

  1. Add tests to your changes.
  2. Make sure they pass running npm test.
  3. Bump the version.
  4. Add an entry to the CHANGELOG.md.
  5. Update the README.md if necessary.
  6. Send a PR.

Readme

Keywords

none

Package Sidebar

Install

npm i @klarna/redux-simple-analytics

Weekly Downloads

1

Version

0.0.3

License

Apache-2.0

Last publish

Collaborators

  • case.taintor