Socket
Book a DemoInstallSign in
Socket

make-event-props

Package Overview
Dependencies
Maintainers
1
Versions
14
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.

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
1.8M
2.8%
Maintainers
1
Weekly downloads
 
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

react

FAQs

Package last updated on 22 Mar 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.