make-event-props

    1.3.0 • Public • Published

    npm downloads CI dependencies dev dependencies tested with jest

    Make-Event-Props

    A function that, given props, returns an object of event callback props optionally curried with additional arguments.

    This package allows you to pass event callback props to a rendered DOM element without the risk of applying any invalid props that could cause unwanted side effects.

    tl;dr

    • Install by executing npm install make-event-props or yarn add make-event-props.
    • Import by adding import makeEventProps from 'make-event-props'.
    • Create your event props object:
      get eventProps() {
        return makeEventProps(this.props, (eventName) => additionalArgs);
      }
    • Use your event props:
      render() {
        return (
          <div {...this.eventProps} />
        );
      }

    License

    The MIT License.

    Author

    Wojciech Maj
    kontakt@wojtekmaj.pl
    https://wojtekmaj.pl

    Install

    npm i make-event-props

    DownloadsWeekly Downloads

    370,886

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    15.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • wojtekmaj