Interface JustEventDuo<Type, Value, Meta>
Type Parameters
-
Type extends string
-
Value
-
Meta extends JustMeta
- JustEventDuo(value: Value, meta: Meta): JustDuo<Value, Meta>
-
Returns JustDuo<Value, Meta>
Properties
type
type: Type
Methods
emitBy
- emitBy(emitter: EventEmitterLike | EventTargetLike, value: Value, meta: Meta): void
-
Parameters
-
emitter: EventEmitterLike | EventTargetLike
-
value: Value
-
meta: Meta
Returns void
listenTo
- listenTo(emitter: EventEmitterLike | EventTargetLike, listener: ((value: Value, meta: Meta) => unknown)): void
-
Parameters
-
emitter: EventEmitterLike | EventTargetLike
-
listener: ((value: Value, meta: Meta) => unknown)
-
- (value: Value, meta: Meta): unknown
-
Returns unknown
Returns void
listener
- listener(listener: ((value: Value, meta: Meta) => unknown)): ((...args: any[]) => any)
-
Parameters
-
listener: ((value: Value, meta: Meta) => unknown)
-
- (value: Value, meta: Meta): unknown
-
Returns unknown
Returns ((...args: any[]) => any)
-
- (...args: any[]): any
-
Returns any
Create event argments as in
emitter.emit(event.type, ...event(value, meta))
.