📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

@drawbotics/enums

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@drawbotics/enums

A small utility to create reliable enums.

0.2.0
latest
npm
Version published
Maintainers
3
Created
Source

Enums

A small utility to create reliable enums.

Installation

$ npm i @drawbotics/enums

Usage

import Enum from '@drawbotics/enums';
import PropTypes from 'prop-types';


const Categories = new Enum('PRIMARY', 'SECONDARY');


const Button = ({ category, children }) => {
  return (
    <button className={category === Categories.PRIMARY ? 'primary' : 'secondary'}>
      {children}
    </button>
  );
};


Button.propTypes = {
  category: PropTypes.oneOf(Object.keys(Categories)),
};


export default Button;

FAQs

Package last updated on 13 Jun 2019

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