You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@ogre-tools/injectable

Package Overview
Dependencies
Maintainers
2
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ogre-tools/injectable

A brutal dependency injection container

17.11.1
latest
Source
npmnpm
Version published
Weekly downloads
491
-42.57%
Maintainers
2
Weekly downloads
 
Created
Source

Dependency injection container for Ogre Tools

A brutal dependency injection container

Usage

$ npm install @ogre-tools/injectable

...

import { createContainer } from '@ogre-tools/injectable';  

Usage

it('given an injectable is registered, when injected, injects', () => {
  const di = createContainer();

  
  const someInjectable = getInjectable({
    id: 'some-id',
    instantiate: () => 'some-instance',
  });
  
  di.register(someInjectable);

  const actual = di.inject(someInjectable);

  expect(actual).toBe('some-instance');
});

Documentation

Check unit tests for documentation.

Keywords

dependency-injection

FAQs

Package last updated on 29 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts