ObserverList

Monster/Types. ObserverList

With the help of the ObserverList class, observer can be managed.

you can call the method via the monster namespace new Monster.Types.ObserverList().

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.6.0/dist/modules/types/observerlist.js';
console.log(new Monster.Types.ObserverList())
console.log(new Monster.Types.ObserverList())
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.6.0/dist/modules/types/observerlist.js';
console.log(ObserverList())
console.log(ObserverList())
</script>

Constructor

new ObserverList()

Source:
Since:
  • 1.0.0

Methods

attach(observer) → {ObserverList}

Source:
Parameters:
Name Type Description
observer Observer
Throws:

value is not an instance of Observer

Type
TypeError
Returns:
Type
ObserverList

contains(observer) → {boolean}

Source:
Parameters:
Name Type Description
observer Observer
Throws:

value is not an instance of Observer

Type
TypeError
Returns:
Type
boolean

detach(observer) → {ObserverList}

Source:
Parameters:
Name Type Description
observer Observer
Throws:

value is not an instance of Observer

Type
TypeError
Returns:
Type
ObserverList

notify(subject) → {Promise}

Source:
Parameters:
Name Type Description
subject
Returns:
Type
Promise