chore: remove extra file

This commit is contained in:
Jacob Nguyen
2023-04-29 18:05:37 -05:00
parent 7f59f81b35
commit 6a65dac272
3 changed files with 24 additions and 25 deletions

View File

@@ -1,2 +1 @@
export { single, transient } from './lifetimeFunctions';
export { useContainerRaw } from './provider';
export { useContainerRaw, single, transient } from './provider';

View File

@@ -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<T>(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<T>(cb: (() => () => T) ) {
return cb;
}

View File

@@ -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<T>(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<T>(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<T extends AnyDependencies>(
conf: DependencyConfiguration<T>
) {
//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) {