Ignition
With your providers defined, its time to ignite Oh My Prvd.
Preloading
It's necessary to preload your providers to for Oh My Prvd to pick it up. For
convenience, you can use either loadChildren()
or the loadDescendants()
function, which will load all providers from a parent's children or
descendants respectively:
You can also pass a predicate function to filter the target modules:
Oh My Prvd includes a built-in predicate for only requiring modules that matches
a given name. Call the matchesName(name)
function, and it will return a
predicate that passes modules if it matches the given name:
Ignition
Finally, ignite Oh My Prvd, and you're off to the races:
If another script requires Oh My Prvd to be ignited, awaitIgnition()
can be
used, which will yield until Oh My Prvd is fully ignited:
Alternatively, if you need to bind to ignition, onIgnition(callback)
can be
used, which will spawn the callback when Oh My Prvd has fully ignited: