deferred-method v1.0.1 is a lightweight utility for queueing method calls on an object until a 'ready' condition is met. It listens for a 'ready' event by default, buffering invocations and replaying them in order once the object is ready. Commonly used with async resources like database connections or message queues. Simple API: only one function and minimal overhead. Last updated in 2020, stable with no new releases expected.
npm install deferred-methodNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates queuing method calls before ready and replaying after ready event.
Ensure the method is defined before calling deferred().
Pass a custom ready listener as third argument, e.g., deferred(obj, 'method', obj.once.bind(obj, 'customEvent')).
After ready, calls execute immediately in order; no queuing after ready.
Use default import: import deferred from 'deferred-method' or const deferred = require('deferred-method').Ensure the method exists before calling deferred(obj, 'methodName').
Provide a custom ready function that triggers when the object is ready.
No dependency data recorded yet.