1.1.1 • Published 4 years ago
@newstudios/hook v1.1.1
@newstudios/hook
Installation
npm install @newstudios/hookor
yarn add @newstudios/hookStarter
hooks
useArrowKeylisten to arrow key state change and get the latest stateuseInvalidatoruse invalidator to invalidate the target at the next animation frameuseCanvasInvalidatora special invalidator to draw canvas at the next aniation frameuseClickAwaylisten click event outside the targetuseDevicePixelRatiolisten to the device pixel ratio change and get the latest devicePixelRatiouseDraga simple hook to process the dragging state and callbackuseEventa hook to bind listener(s) to event targetuseHovera hook to get the mouse hover state of the targetuseLista hook to manage collectionsuseUpdateget a static callback to force update the componentuseNextUpdateget a static callback to update the componenent next event loopuseRafa hook to call requestAnimationFrame whose lifecycle is self manageduseRefObjecta hook to reference any object from the argumentuseResizea hook to listen to the resize event of the targetuseResizeObservera hook to get the default or customed provided ResizeObserver instanceuseSafeClickmanage the click event from the target and assure the gesture not to be dragginguseSetupCanvasa hook for setup the canvas and set the canvas width and height automaticallyuseShortcutKeylisten to the shortcut keyuseShortcutKeyslisten to the multiple shortcut keysuseThrottleinvoke a callback with throttleuseThrottleCallbackget a callback which will be invoked with throttle
LICENSE
MIT
1.1.1
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago
0.2.8
5 years ago
0.2.7
5 years ago
0.2.6
5 years ago
0.2.1
5 years ago
0.2.3
5 years ago
0.2.2
5 years ago
0.2.5
5 years ago
0.2.4
5 years ago
0.2.0
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.6
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago