trigger-hands
v1.0.1
Published
Downloads
19
Readme
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)
