From 2625b2a1422e0b5418b852b30a3fcd6b1d44ca15 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 15 Nov 2021 22:22:55 -0600 Subject: [PATCH] Allow retrieving value later --- package.json | 2 +- src/decorators/inject.ts | 1 + src/field.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index dca2c7c..62aa653 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@technove/inject", "description": "Dependency injection for TypeScript", - "version": "0.1.5", + "version": "0.1.6", "author": "PaulBGD", "license": "MIT", "scripts": { diff --git a/src/decorators/inject.ts b/src/decorators/inject.ts index 88b5154..695cb5e 100644 --- a/src/decorators/inject.ts +++ b/src/decorators/inject.ts @@ -71,6 +71,7 @@ export const Inject: ( defaultValue, target, type: propertyType, + getValue: () => val, }; const retrieved = retrievalProvider(container, field); diff --git a/src/field.ts b/src/field.ts index 35a3306..fe72f05 100644 --- a/src/field.ts +++ b/src/field.ts @@ -9,6 +9,8 @@ export type FieldProperty = { type: PropertyType; name: string; defaultValue: T; + + getValue(): T; }; export type FieldParameter = {