Advertisement
Guest User

Untitled

a guest
Jan 11th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @InversifyRootModule({
  2.   imports: [
  3.     ModuleWithoutConfiguration,
  4.     ModuleWithConfiguration.configure({ foo: 'bar' })
  5.   ]
  6. })
  7. class RootModule {}
  8.  
  9. class ModuleWithoutConfiguration {
  10.    public static getModule(): ModuleLoadResult {
  11.       return new InversifyModule(...);
  12.    }
  13. }
  14.  
  15. class ModuleWithConfiguration {
  16.     public static configure(opts: { foo: string }): ModuleWithOptionsDescriptor {
  17.         return {
  18.           getModule(): ModuleLoadResult {
  19.             return {
  20.               inversifyModule: new ContainerModule(...);
  21.             };
  22.          },
  23.          moduleType: Module2,
  24.        } as InversifyChildModule;
  25.    }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement