### File

`src/app/shared/services/emitter.service.ts`

### Description

A simple pubsub service using EventEmitter

### Index

###### Properties

- Private Static _emitters

###### Methods

- Static get

### Methods

Static get
`get(ID: string)`
Defined in src/app/shared/services/emitter.service.ts:10

Parameters :

Name | Type | Optional
ID | `string` | No

Returns : `EventEmitter<any>`

### Properties

Private Static _emitters
Type : `literal type`
Default value : `{}`
Defined in src/app/shared/services/emitter.service.ts:8

    import { Injectable, EventEmitter } from '@angular/core';

    /**
     * A simple pubsub service using EventEmitter
     */
    @Injectable()
    export class EmitterService {
        private static _emitters: { [ID: string]: EventEmitter<any> } = {};

        static get(ID: string): EventEmitter<any> {
            if (!this._emitters[ID]) this._emitters[ID] = new EventEmitter();
            return this._emitters[ID];
        }
    }

# results matching ""

# No results matching ""