Function lifecycled

  • Parameters

    • root: {}
      • onInit: ((object) => void) = ...
          • (object): void
          • Parameters

            • object: {}

              Returns void

        • onKill: ((object) => void) = ...
            • (object): void
            • Parameters

              • object: {}

                Returns void

          Returns Promise<{}>

          Description

          Decorator for entry point class

          Example

          import { lifecycled, init, kill } from '../../src';

          class Uno {
          @init() public initialize() {
          console.log('Uno init');
          }

          @kill() public destructor() {
          console.log('Uno kill');
          }
          }

          class Dos {
          @init() public initialize() {
          console.log('Dos init');
          }

          @kill() public destructor() {
          console.log('Dos kill');
          }
          }

          class Tres {
          @init() public initialize() {
          console.log('Tres init');
          }

          @kill() public destructor() {
          console.log('Tres kill');
          }
          }

          class Root {
          uno = new Uno();
          dos = new Dos();
          tres = new Tres();
          }

          lifecycled(new Root());

          // Uno init
          // Dos init
          // Tres init
          // Uno kill
          // Dos kill
          // Tres kill

        Generated using TypeDoc