Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

trigger-hands

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trigger-hands

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Trigger Hands

Trigger Hands is a library focus on handling events and callback from user input. This library can shape callback, mainly used in react to respond to different callback.

event

This will pass the event from a callback to a trigger function. This can be a user defined function or a compound trigger function.


    <button type="text" onClick={trigger.event(submitForm)>Click Me </button>

    //will call upon event
    updateUsername(/* value of input element*/)

value

This will get the value passed from an event and pass this to user function or trigger function.

    <input type="text" value={user.name} onClick={trigger.value(updateUsername)/>

    //will call upon event
    updateUsername(/* value of input element*/)
    

couple

This will couple a predetermined value to a user function or trigger function

    <button onClick={trigger.couple(trigger.spread(user,role),Authentication)}>Click Me </button>

    //will call
    Authentication(user,role)
    

spread

use spread to pass multiple values to a user function or trigger function

    <button onClick={trigger.couple(trigger.spread(user,role),Authentication)}>Click Me </button>

    //will call upon event
    Authentication(user,role)

FAQs

Package last updated on 02 Feb 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