From f4ff34c4ef5ec19085603650c83b978c48778443 Mon Sep 17 00:00:00 2001 From: Evyweb Date: Sat, 26 Oct 2024 16:58:50 +0200 Subject: [PATCH] docs: remove draft --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 534dfae..ec11b92 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ -# A simple IOC container in Typescript (DRAFT) +# A simple IOC container for Typescript ![logo-ioctopus.png](assets/logo-ioctopus.png) ## Introduction -This is just a **draft** of an attempt to create a simple IOC (Inversion of Control) container in Typescript. -The idea behind is to create a simple container that can be used to register and resolve dependencies working with functions and without reflect metadata. +An IOC (Inversion of Control) container for Typescript. +The idea behind is to create a simple container that can be used to register and resolve dependencies working with classes & functions but without reflect metadata. It is using simple Typescript code, so it can be used in any project without any dependency. -Should work in NextJS middleware and edge runtime. -Remember that it is just a draft and it is not ready for production. +Works in NextJS middleware and edge runtime. ## Installation ```npm i @evyweb/ioctopus``` @@ -31,8 +30,7 @@ export const DI: InjectionTokens = { HIGHER_ORDER_FUNCTION_WITHOUT_DEPENDENCIES: Symbol('HIGHER_ORDER_FUNCTION_WITHOUT_DEPENDENCIES') } ; ``` - -### Register the dependencies +Then create your container. ```typescript import { DI } from './di'; @@ -40,6 +38,8 @@ import { DI } from './di'; const container: Container = createContainer(); ``` +### Register the dependencies + - You can register primitives ```typescript container.bind(DI.DEP1).toValue('dependency1'); @@ -142,6 +142,3 @@ myUseCase.execute(); ``` Code used in the examples can be found in the specs folder. - -This is just a draft, and it is not ready for production. -Can be improved in many ways.