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

make-event-props

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

make-event-props

Returns an object with on-event callback props curried with provided args.

  • 1.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is make-event-props?

The make-event-props npm package is designed to help developers create event properties for React components. It simplifies the process of binding event handlers to components by generating the necessary props for a given set of event names.

What are make-event-props's main functionalities?

Generate Event Props

This feature allows you to generate event properties for a set of event names. You provide the event names and corresponding handlers, and the package returns an object with the event properties.

const makeEventProps = require('make-event-props');

const eventNames = ['onClick', 'onMouseEnter'];
const eventHandlers = {
  onClick: () => console.log('Clicked!'),
  onMouseEnter: () => console.log('Mouse Entered!')
};

const props = makeEventProps(eventNames, eventHandlers);
console.log(props); // { onClick: [Function], onMouseEnter: [Function] }

Filter Event Handlers

This feature allows you to filter and include only the event handlers that match the provided event names. It helps in managing and organizing event handlers efficiently.

const makeEventProps = require('make-event-props');

const eventNames = ['onClick', 'onMouseEnter', 'onMouseLeave'];
const eventHandlers = {
  onClick: () => console.log('Clicked!'),
  onMouseEnter: () => console.log('Mouse Entered!'),
  onMouseLeave: () => console.log('Mouse Left!')
};

const props = makeEventProps(eventNames, eventHandlers);
console.log(props); // { onClick: [Function], onMouseEnter: [Function], onMouseLeave: [Function] }

Other packages similar to make-event-props

Keywords

FAQs

Package last updated on 18 Oct 2023

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