mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
fix swap not accepting functions
This commit is contained in:
@@ -38,7 +38,11 @@ const dependencyBuilder = (container: Container) => {
|
||||
* Swap out a preexisting dependency.
|
||||
*/
|
||||
swap(key: keyof Dependencies, v: Insertable) {
|
||||
container.swap(key, v);
|
||||
if(typeof v !== 'function') {
|
||||
container.swap(key, v);
|
||||
} else {
|
||||
container.swap(key, v(container.deps()));
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@ import ready from './handlers/ready';
|
||||
import messageHandler from './handlers/message';
|
||||
import interactionHandler from './handlers/interaction';
|
||||
import { presenceHandler } from './handlers/presence';
|
||||
import { handleCrash } from './handlers/event-utils';
|
||||
import { UnpackedDependencies } from './types/utility';
|
||||
import type { Presence} from './core/presences';
|
||||
import { registerTasks } from './handlers/tasks';
|
||||
|
||||
Reference in New Issue
Block a user