Decorators pack for bring lifecycle control in you application
npm install @biorate/lifecycledDecorators pack for bring lifecycle control in you application
#### Example:
``ts
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
``
- Documentation can be found here - docs.
See the CHANGELOG
Copyright (c) 2021-present Leonid Levkin (llevkin)