From 6a65dac2726989e365709473a21541a94ed44abf Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sat, 29 Apr 2023 18:05:37 -0500 Subject: [PATCH] chore: remove extra file --- src/core/dependencies/index.ts | 3 +-- src/core/dependencies/lifetimeFunctions.ts | 22 -------------------- src/core/dependencies/provider.ts | 24 +++++++++++++++++++++- 3 files changed, 24 insertions(+), 25 deletions(-) delete mode 100644 src/core/dependencies/lifetimeFunctions.ts diff --git a/src/core/dependencies/index.ts b/src/core/dependencies/index.ts index 52bef44..01940b5 100644 --- a/src/core/dependencies/index.ts +++ b/src/core/dependencies/index.ts @@ -1,2 +1 @@ -export { single, transient } from './lifetimeFunctions'; -export { useContainerRaw } from './provider'; +export { useContainerRaw, single, transient } from './provider'; diff --git a/src/core/dependencies/lifetimeFunctions.ts b/src/core/dependencies/lifetimeFunctions.ts deleted file mode 100644 index 2f71f8d..0000000 --- a/src/core/dependencies/lifetimeFunctions.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @__PURE__ - * @since 2.0.0. - * Please note that on intellij, the deprecation is for all signatures, which is unintended behavior (and - * very annoying). - * For future versions, ensure that single is being passed as a **callback!!** - * @param cb - */ -export function single(cb: () => T) { - return cb; -} - -/** - * @__PURE__ - * @since 2.0.0 - * Following iti's singleton and transient implementation, - * use transient if you want a new dependency every time your container getter is called - * @param cb - */ -export function transient(cb: (() => () => T) ) { - return cb; -} diff --git a/src/core/dependencies/provider.ts b/src/core/dependencies/provider.ts index 5271043..cc956aa 100644 --- a/src/core/dependencies/provider.ts +++ b/src/core/dependencies/provider.ts @@ -10,6 +10,28 @@ import { AnyWrapper, ServerlessWrapper, WebsocketWrapper } from '../structures/w export const containerSubject = new BehaviorSubject(defaultContainer()); +/** + * @__PURE__ + * @since 2.0.0. + * Please note that on intellij, the deprecation is for all signatures, which is unintended behavior (and + * very annoying). + * For future versions, ensure that single is being passed as a **callback!!** + * @param cb + */ +export function single(cb: () => T) { + return cb; +} + +/** + * @__PURE__ + * @since 2.0.0 + * Following iti's singleton and transient implementation, + * use transient if you want a new dependency every time your container getter is called + * @param cb + */ +export function transient(cb: (() => () => T) ) { + return cb; +} /** * Given the user's conf, check for any excluded dependency keys. * Then, call conf.build to get the rest of the users' dependencies. @@ -19,7 +41,7 @@ export const containerSubject = new BehaviorSubject(defaultContainer()); export function composeRoot( conf: DependencyConfiguration ) { - //Get the current container. This should have no client or possible logger yet. + //This should have no client or logger yet. const currentContainer = containerSubject.getValue(); const excludeLogger = conf.exclude?.has('@sern/logger'); if (!excludeLogger) {