Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
/*
 * 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";