Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
get-ready
Advanced tools
Readme
Fork from supershabam/ready
one-time ready event object.
Create ready
event object.
import { Ready } from 'get-ready';
const obj = new Ready();
// register a callback
obj.ready(() => console.log('ready'));
// mark ready
obj.ready(true);
Register a callback to the callback stack, it will be called when mark as ready, see example above.
If the callback is undefined, register will return a promise.
obj.ready().then(() => console.log('ready'));
obj.ready(true);
If it has been ready, the callback will be called immediately.
// already ready
obj.ready(true);
obj.ready().then(() => console.log('ready'));
Warning: the callback is called after nextTick
Mark it as ready, you can simply using .ready(true)
.
You can also mark it not ready.
obj.ready(true);
// call immediately
obj.ready(() => console.log('ready'));
obj.ready(false);
obj.ready(() => throw 'don\'t run');
When exception throws, you can pass an error object, then the callback will receive it as the first argument.
obj.ready(err => console.log(err));
obj.ready(new Error('err'));
supershabam | fengmk2 | popomore | dead-horse | semantic-release-bot |
---|
This project follows the git-contributor spec, auto updated at Mon Jun 05 2023 14:06:50 GMT+0800
.
FAQs
mixin to add one-time ready event callback handler
The npm package get-ready receives a total of 111,516 weekly downloads. As such, get-ready popularity was classified as popular.
We found that get-ready demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.