Skip to content

Cologler/anyioc-typescript

Repository files navigation

anyioc

Build Status npm

Another simple ioc framework for javascript/typescript.

Install

for Node

npm install anyioc

for Browser

Use packed file dist.browser/anyioc.js.

Usage

import { ServiceProvider } from "anyioc";
const provider = new ServiceProvider();
provider.registerSingleton('the key', ioc => 102); // ioc will be scoped ServiceProvider
value = provider.get('the key'); // 102

There are some predefined key you can use direct, but you still can overwrite it:

  • ioc - get current scoped ServiceProvider instance.
  • provider - alias of ioc

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published