Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@uxland/ioc

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uxland/ioc

IOC

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
2
Created
Source

UXL IOC npm version

Build StatusStatementsBranchesFunctionsLines
BuildStatusStatementsBranchesFunctionsLines

Installation

npm i @uxland/ioc

Usage

Register constructor singleton to iocContainer

Registers a constructor singleton to the InversionOfControl container. Each time a reference of the constructor or abstract class is provided with inversify, the container will provide with its singleton pair.

@provideSingleton()
class IOCAdapter {
  method(): void {
    console.log("Calling `method` from `IOCAdapter`");
  }
}

class Adapter {
  constructor(@inject(IOCAdapter) protected adapter: IOCAdapter) {
    this.adapter.method(); // => 'Calling `method` from `IOCAdapter`'
  }
}

Set Mediator resolver

This method overrides the mediator default resolver to use our own container.

const container: Container = new Container();
setMediatorResolver(container);

FAQs

Package last updated on 03 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