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

reactorator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactorator

decorate your components with mixins

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by433.33%
Maintainers
1
Weekly downloads
 
Created
Source

Reactorator

Mixin your mixins and decorate!

import reactorator from 'reactorator';

import { Component } from 'react';
import { state, navigation } from 'react-router';

@reactorator(state, navigation)
class Nav extends Component {
  constructor() {
    super();
  }
  
  render() {
    const path = this.getPath();
    return <h1>Hello { path }</h1>;
  }
}

Takes in mixins that add functionality. But if you try to add mixins that do have a React lifecycle prop reactorator will warn you and let you decide how to continue.

It takes mixins and adds them to the prototype of the Component using Object.assign.

There are other decorators out there that will work with React lifecycle mixins by creating a Higher Order Component but when you are using lots of mixins you end up wrapping your component several layers deep. This is meant to alliviate that pain.

Take with babel es7.classDecorators option.

Keywords

FAQs

Package last updated on 30 May 2015

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