true-di
githubnpm
  • Introduction
  • Core
    • diContainer
    • multiple
    • isReady
    • prepareAll
    • releaseAll
    • factoriesFrom
  • Utils
    • assignProps
    • shallowMerge
  • Recipes
    • Accessing Items
    • Releasing Items
    • Creating All Items
    • Cyclic Dependencies
    • Injection Context
    • Creating Factories before Container
Powered by GitBook
On this page
  • Import
  • Typing:
  • Arguments:
  • Returns:
  • Example:

Was this helpful?

  1. Core

prepareAll

Creates all items in the container.

Import

import { prepareAll } from 'true-di';
const { isReady } = require('true-di');

Typing:

function prepareAll<IContainer>(container: IContainer): IContainer

Arguments:

  • container: IContainer - container to create all its items.

Returns:

  • static copy of the container: IContainer - plain JS-object with fields those are container items.

Example:

import { isReady, prepareAll } from 'true-di/utils';
import container from './container';

prepareAll(container);

console.log(
  isReady(container, 'logger'), 
  isReady(container, 'dataAccessService'), 
  isReady(container, 'ecommerceService')
);
// prints: true true true
PreviousisReadyNextreleaseAll

Last updated 4 years ago

Was this helpful?