How to use the @tsed/common.GlobalProviders.createRegisterFn function in @tsed/common

To help you get started, we’ve selected a few @tsed/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TypedProject / ts-express-decorators / packages / mongoose / src / registries / MongooseModelRegistry.ts View on Github external
* }
 *
 * registerModel({provide: MyModel});
 * // or
 * registerModel(MyModel);
 *
 * const injector = new InjectorService();
 * injector.load();
 *
 * const myModel = injector.get<MyModel>(MyModel);
 * myModel.getFoo(); // test
 * ```
 *
 * @param provider Provider configuration.
 */
export const registerModel = GlobalProviders.createRegisterFn(PROVIDER_TYPE_MONGOOSE_MODEL);
github TypedProject / ts-express-decorators / packages / graphql / src / registries / ResolverServiceRegistry.ts View on Github external
* }
 *
 * registerResolverService({provide: MyFooService});
 * // or
 * registerResolverService(MyFooService);
 *
 * const injector = new InjectorService();
 * injector.load();
 *
 * const myFooService = injector.get<MyFooService>(MyFooService);
 * myFooService.getFoo(); // test
 * ```
 *
 * @param provider Provider configuration.
 */
export const registerResolverService = GlobalProviders.createRegisterFn(PROVIDER_TYPE_RESOLVER_SERVICE);
github TypedProject / ts-express-decorators / packages / passport / src / registries / ProtocolRegistries.ts View on Github external
* }
 *
 * registerSocketService({provide: MyFooService});
 * // or
 * registerSocketService(MyFooService);
 *
 * const injector = new InjectorService();
 * injector.load();
 *
 * const myFooService = injector.get<MyFooService>(MyFooService);
 * myFooService.getFoo(); // test
 * ```
 *
 * @param provider Provider configuration.
 */
export const registerProtocol = GlobalProviders.createRegisterFn(PROVIDER_TYPE_PROTOCOL);
github TypedProject / ts-express-decorators / src / mongoose / registries / MongooseModelRegistry.ts View on Github external
* }
 *
 * registerModel({provide: MyModel});
 * // or
 * registerModel(MyModel);
 *
 * const injector = new InjectorService();
 * injector.load();
 *
 * const myModel = injector.get<MyModel>(MyModel);
 * myModel.getFoo(); // test
 * ```
 *
 * @param provider Provider configuration.
 */
export const registerModel = GlobalProviders.createRegisterFn("mongooseModel");
github TypedProject / ts-express-decorators / src / socketio / registries / SocketServiceRegistry.ts View on Github external
* }
 *
 * registerSocketService({provide: MyFooService});
 * // or
 * registerSocketService(MyFooService);
 *
 * const injector = new InjectorService();
 * injector.load();
 *
 * const myFooService = injector.get<MyFooService>(MyFooService);
 * myFooService.getFoo(); // test
 * ```
 *
 * @param provider Provider configuration.
 */
export const registerSocketService = GlobalProviders.createRegisterFn("socketService");
github TypedProject / ts-express-decorators / packages / socketio / src / registries / SocketServiceRegistry.ts View on Github external
* }
 *
 * registerSocketService({provide: MyFooService});
 * // or
 * registerSocketService(MyFooService);
 *
 * const injector = new InjectorService();
 * injector.load();
 *
 * const myFooService = injector.get<MyFooService>(MyFooService);
 * myFooService.getFoo(); // test
 * ```
 *
 * @param provider Provider configuration.
 */
export const registerSocketService = GlobalProviders.createRegisterFn(PROVIDER_TYPE_SOCKET_SERVICE);