
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@tinkoff/hook-runner
Advanced tools
Library used for subscription on specific events in different styles: sync, async, promise.
Library used for subscription on specific events in different styles: sync, async, promise.
Working with lib consist of two phases:
runAsyncHooks
, with unique event key and additional parameters. It creates a slot for this event that allow to subscribe on the event.registerHooks
that will be executed when run...
function will be calledThere is different types hooks that are not interoperable. So carefully add new registrations with checking expected hook type.
Also you should preserve data chain, e.g. return data with same interface from hook, as it otherwise may break other hooks.
Create new instance of @tinkoff/hook-runner
import { Hooks } from '@tinkoff/hook-runner';
const hookRunner = new Hooks();
Register new hook for a specific key.
Execute sync hooks. payload
is passed through every hook and will be returned as a result (it may be changed by hooks).
Executes async hooks using setTimeout. payload
is passed to every hook with its initial value.
Execute promise-based hooks. payload
is passed through every hook and will be returned as a result (it may be changed by hooks)
Accepts (context, payload, options). Hooks are running in order passing previous hook result as input for next hook.
Accepts (context, payload, options). Hooks are running independently from each other.
Accepts (context, payload, options). Hooks are running in order passing previous hook result as input for next hook with wrapping call in promise.
FAQs
Library used for subscription on specific events in different styles: sync, async, promise.
We found that @tinkoff/hook-runner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.