Repository URL to install this package:
|
Version:
1.2.7 ▾
|
/*
* This is purely a tiny event-emitter/pubsub
*/
// export interface LifecycleClass {
// listeners: Array<() => void>,
// addListener(callback: Function): void,
// emit(): void,
// }
//
// export function Lifecycle() {
// this.listeners = []
// }
//
// Lifecycle.prototype.addListener = function addListener(callback) {
// this.listeners.push(callback)
// }
// Lifecycle.prototype.emit = function emit() {
// const listeners = this.listeners
//
// let listener
// // We need to remove current listener from array when calling it, because more listeners might be added
// while ((listener = listeners.shift())) {
// listener()
// }
// }
"use strict";