Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@workpop/redux-tracer

Package Overview
Dependencies
Maintainers
13
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workpop/redux-tracer

Create New Relic Tracers and bind them to React Components

  • 0.1.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
13
Created
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

Package last updated on 18 Jul 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc