Commit 96cc77e7 authored by nanahira's avatar nanahira

fix inject

parent f4e04082
Pipeline #6054 passed with stages
in 35 seconds
{
"name": "koishi-nestjs",
"version": "1.0.6",
"version": "1.0.7",
"description": "Koishi.js as Nest.js Module",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
......
......@@ -17,31 +17,35 @@ import {
KOISHI_CONTEXT_PRIVATE,
KOISHI_MODULE_OPTIONS,
} from './koishi.constants';
const koishiContextProviderAny: Provider = {
const koishiContextProvider: Provider = {
provide: KOISHI_CONTEXT,
inject: [KoishiService],
useFactory: (koishiApp: KoishiService) => koishiApp.any(),
};
const koishiContextProviderChannel: Provider = {
provide: KOISHI_CONTEXT_CHANNEL,
inject: [KoishiService],
useFactory: (koishiApp: KoishiService) => koishiApp.channel(),
};
const koishiContextProviderPrivate: Provider = {
provide: KOISHI_CONTEXT_PRIVATE,
inject: [KoishiService],
useFactory: (koishiApp: KoishiService) => koishiApp.private(),
};
@Module({
providers: [
KoishiService,
koishiContextProviderAny,
koishiContextProvider,
koishiContextProviderChannel,
koishiContextProviderPrivate,
],
exports: [
KoishiService,
koishiContextProviderAny,
koishiContextProvider,
koishiContextProviderChannel,
koishiContextProviderPrivate,
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment