- justEvent(type: string): JustEventEmpty<typeof type>
-
- justEvent(type: string, defaultListener: ((value: void) => unknown)): JustEventEmpty<typeof type> & {
defaultListener: (() => unknown);
}
-
Parameters
-
type: string
-
defaultListener: ((value: void) => unknown)
-
- (value: void): unknown
-
Returns unknown
Returns JustEventEmpty<typeof type> & {
defaultListener: (() => unknown);
}
- justEvent<Value>(type: string, defaultListener: ((value: Value) => unknown)): JustEventUno<typeof type, Value> & {
defaultListener: ((value: Value) => unknown);
}
-
Parameters
-
type: string
-
defaultListener: ((value: Value) => unknown)
-
- (value: Value): unknown
-
Returns unknown
Returns JustEventUno<typeof type, Value> & {
defaultListener: ((value: Value) => unknown);
}
- justEvent<Value>(type: string): JustEventUno<typeof type, Value>
-
- justEvent<Value, Meta>(type: string): JustEventDuo<typeof type, Value, Meta>
-
Type Parameters
-
Value
-
Meta extends JustMeta
- justEvent<Value, Meta>(type: string, defaultListener: ((value: Value, meta: Meta) => unknown)): JustEventDuo<typeof type, Value, Meta> & {
defaultListener: ((value: Value, meta: Meta) => unknown);
}
-
Type Parameters
-
Value
-
Meta extends JustMeta
Parameters
-
type: string
-
defaultListener: ((value: Value, meta: Meta) => unknown)
-
- (value: Value, meta: Meta): unknown
-
Returns unknown
Returns JustEventDuo<typeof type, Value, Meta> & {
defaultListener: ((value: Value, meta: Meta) => unknown);
}
Creates just an event that is typed and easy to use.