A set of hooks and HOCs for pilets and Piral instances.
This should only be installed as a dependency (dependencies
) as it is only designed mostly for runtime/consumption by Piral or pilets. You could also share it explicitly or implicitly from your Piral instance if you'd like to optimize usage in your pilets. It's not required though as the code provided by it is minimal and tree-shakable.
If you'd love to use yarn:
yarn add piral-hooks-utils
Alternatively, npm works reliably, too:
npm i --save piral-hooks-utils
The following hooks are included.
A hook to indicate something was suddenly visible.
Gives a full async lifecycle in a hook.
Hook that locks scrolling on the main document.
Hook that detects if a click outside the given reference has been performed.
Hook that detects if a reference element within the main document is visible.
Retrieves the Pilet API stored in the provider.
Hook to notify the user in case of potential data loss when performing a page transition (internal or external).
Piral is released using the MIT license. For more information see the license file.