JSPM

redux-lytics

1.3.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 10
    • Score
      100M100P100Q21180F
    • License MIT

    Redux middleware to track analytics

    Package Exports

    • redux-lytics

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redux-lytics) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Redux-lytics

    Redux-lytics is a simple Redux middleware used to log events to a external service through HTTP POST requests.

    Getting Started:

    Install redux-lytics:

    • NPM: npm install redux-lytics
    • Yarn: yarn add redux-lytics

    Usage:

    // index.js
    import { createLogger } from 'redux-lytics';
    import { config, defaultHeaders } from './config';
    const logger = createLogger(config, defaultHeaders);
    const middleware = [logger];
    
    // config.js
    export const config = {
        INCREMENT: {
          url: "/analytics",
          body: {'key': "hello"},
          headers: {}
        }
      };
    
    export const defaultHeaders = {
        Accept: 'application/json'
    };