New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

revenge

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

revenge

react component utilities

latest
Source
npmnpm
Version
0.4.5
Version published
Weekly downloads
2.2K
16.32%
Maintainers
1
Weekly downloads
 
Created
Source

A collection of small React Component helpers

@pure

mark a Component as pure (perf)

import { pure } from 'revenge';

@pure // will add a default shouldComponentUpdate implementation
class UserCard extends React.Component {}

@skinnable()

split logic and rendering (testability)

import { skinnable } from 'revenge';

@skinnable() // or @skinnable(mytemplate)
class UserCard extends React.Component {

  getLocals() { // logic here
    return {
      name: this.props.user.name;
    };
  }

  template(locals) { // rendering here
    return <p>{locals.name}</p>;
  }

}

@skinnable(contains(Component))

wrap "template" components in a "smart/container" component

import { skinnable, contains } from 'revenge';

const UserCard = ({ name }) => <p>{name}</p>;

@skinnable(contains(UserCard))
class UserCardContainer extends React.Component {
  getLocals() {
    // ...complex logic to obtain data...
    return { name };
  }
}

FAQs

Package last updated on 09 Jun 2016

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