Options
All
  • Public
  • Public/Protected
  • All
Menu

The Service Manager controls the lifecycle of all Services in an App

Hierarchy

Index

Constructors

constructor

Properties

app

app: IApp

The App the AdvancedManager is attached to

config

config: ICONFIG

The Config of the App the AdvancedManager is attached to

emitter

emitter: EventEmitter

The EventEmitter of the App the AdvancedManager is attached to

map

map: Map<string, Service>

For backward compatability and performance reasons Manager use Map to store data

Accessors

length

  • get length(): number
  • An alias for size

    Returns number

size

  • get size(): number
  • Returns the total number of items stored in the Manager

    Returns number

Methods

[iterator]

  • [iterator](): IterableIterator<[string, Service]>

add

  • Adds a value to Manager, and uses the current size of the Manager as it's key, it works best when all the key in the Manager are numbers

    Parameters

    Returns Manager<string, Service>

boot

  • Call the boot method for all Services

    Returns ServiceManager

clear

delete

  • delete(key: string): boolean
  • Removes a value stored in the Manager via a key, returns true if an element in the Map object existed and has been removed, or false if the element does not exist

    Parameters

    • key: string

    Returns boolean

entries

  • entries(): IterableIterator<[string, Service]>
  • Returns a new Iterator object that contains an array of [key, value] for each element in the Map object in insertion order.

    Returns IterableIterator<[string, Service]>

forEach

  • Iterates through the Managers contents, calling a callback function every iteration

    Parameters

    • callback: (value?: Service, key?: string, map?: Map<string, Service>) => void
        • Parameters

          • Optional value: Service
          • Optional key: string
          • Optional map: Map<string, Service>

          Returns void

    • Optional context: object

    Returns Manager<string, Service>

get

  • Get a value stored in the Manager

    Parameters

    • key: string

    Returns Service

getMap

  • Returns the Manager classes base Map

    Returns Map<string, Service>

has

  • has(key: string): boolean
  • Checks if the Manager contains a certain key

    Parameters

    • key: string

    Returns boolean

init

  • Call the init method for all Services

    Returns ServiceManager

keys

  • keys(): string[]
  • Returns the keys of all items stored in the Manager as an Array

    Returns string[]

last

  • Returns the last item in the Manager who's index is a certain distance from the last item in the Manager

    Parameters

    • distance: number = 1

    Returns Service

remove

  • Removes a value stored in the Manager via a key, returns the Manager class, allowing for chains

    Parameters

    • key: string

    Returns Manager<string, Service>

set

stop

  • Call the stop method for all Services

    Returns ServiceManager

values

  • Returns the values of all items stored in the Manager as an Array

    Returns Service[]

Generated using TypeDoc