@biorate/lifecycled
v1.54.0
Published
Decorators pack for bring lifecycle control in you application
Downloads
179
Readme
Lifecircle
Decorators pack for bring lifecycle control in you application
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
Learn
- Documentation can be found here - docs.
Release History
See the CHANGELOG
License
Copyright (c) 2021-present Leonid Levkin (llevkin)