Skip to content
function since v0.1

onMethodImplemented

Called when a provider implements a method. Handlers are expected to be infallible and non-yielding. The handler receives the constructed provider. Commonly used to implement custom lifecycles by adding providers to a "watchlist" which will have its methods fired.

function prvd.onMethodImplemented(
  method: string,
  handler: (Provider<unknown>) -> ()
): ()
export const onMethodImplemented: (
  method: string,
  handler: (Provider<unknown>) => void
) => void

Parameters

method : string

The method to implement. During ignition, all providers that specify this method will have its handler be called.

handler : (Provider<unknown>) -> void

A handler for providers that implement the specified methods. It receives the provider which implements the method. Commonly used to implement custom lifecycles by adding providers to a "watchlist" which will have its methods fired.