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>
updateUsername()
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)/>
updateUsername()
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>
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>
Authentication(user,role)