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

releaseAll

Releases (unbinds) all items from the container.

Import

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

Typing

function releaseAll<IContainer extends object>(container: IContainer): void

Arguments:

  • container: IContainer - container to unbind items from

Returns:

  • nothing

Example:

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

releaseAll(container);

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

Last updated 4 years ago

Was this helpful?