Socket
Socket
Sign inDemoInstall

@workpop/redux-tracer

Package Overview
Dependencies
6
Maintainers
13
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @workpop/redux-tracer

Create New Relic Tracers and bind them to React Components


Version published
Weekly downloads
0
decreased by-100%
Maintainers
13
Install size
124 kB
Created
Weekly downloads
 

Readme

Source

redux-tracer

Installation

yarn add @workpop/redux-tracer

API

  • createTracer
type CreateTracerType = {
  invariant?: Function,
  tracerName: string,
  // Custom Attributes you want to seet in new relic
  customAttributes: Object,
  log: Function,
}
  • getNRTracer(state: Object, tracerName: string)

  • clearTracer(tracerName: string)

Basic Usage

1.Setup in combineReducers

import { createStore } from 'redux';
import { newRelicTracerReducer } from '@workpop/redux-tracer';
...  
const store = createStore({
  ...reducers,
  newRelicTracerReducer,
});
  1. Dispatch createTracer action
import { createTracer } from '@workpop/redux-tracer';

store.dispatch(
  createTracer({
    tracerName: 'testTracer',
  })
);
  1. Connect and execute tracer
import React from 'react';
import { connect } from 'react-redux';
import { getNRTracer } from '@workpop/redux-tracer';

function Test({ testTracer }) {
  return <p onClick={function () { return testTracer(); }}>Hello</h1>
}

function mapStateToProps(state) {
  return getNRTracer(state, 'testTracer');
}

export default connect(mapStateToProps)(Test)

License

MIT

FAQs

Last updated on 18 Jul 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc