A default version of the @gearAdvanced with the token already provided.
Works as a isProvider for the @provider.
A default version of the @providerAdvanced with the token already provided.
A decorator that creates a Storeon store provider. See @provider for more information.
A default version of the @storeonAdvanced with the token already provided.
Creates tokens to bind decorators with each other.
A default version of the @dispatcherAdvanced with the token already provided.
A decorator that converts a class method or field to a storeon dispatcher. There are three possible types of the dispatcher.
Literally, it is a storeon.dispatch
method bound to a class property. To
get it, omit the eventKey
parameter while applying the decorator to a class
field.
Signature of the resulting method is the following:
method(eventKey: PropertyKey, data: unknown): void;
@storeon
class StoreonComponent extends HTMLElement {
@dispatcher() dispatch!: (eventKey: PropertyKey, data: number) => void ;
run(): void {
this.dispatch('inc', 10);
}
}
It is a curried version of the storeon.dispatch
with the predefined
eventKey
. To get it, send the eventKey
parameter while applying the
decorator to a class field.
Signature of the resulting method is the following:
method(data: unknown): void;
@storeon
class StoreonComponent extends HTMLElement {
@dispatcher('inc') increase!: (data: number) => void;
run() {
this.increase(10);
}
}
This kind of dispatcher calculates its value before dispatching and then acts
like a specified dispatcher. To get it, apply the
decorator with provided eventKey
parameter to a method. The result the
method returns will be dispatched.
@storeon
class StoreonComponent extends HTMLElement {
@dispatcher('inc')
increase(num1: number, num2: number): number {
return num1 * num2;
}
run(): void {
this.increase(10, 10);
}
}
a token issued by a createStoreonToken function that connects all decorators in a single working system.
a name of the event this dispatcher will trigger on call.
A default version of the @isProviderAdvanced with the token already provided.
A decorator that makes a class declaration a Storeon provider with a store as a context value. The @consumer decorator is used internally.
a token issued by a createStoreonToken function that connects all decorators in a single working system.
A default version of the @storeonAdvanced with the token already provided.
A decorator that makes a class property a reflection for the specific store value. Whenever the value is changed, the property receives an update as well.
@storeon
class StoreonComponent extends HTMLElement {
@unit('count') count!: number;
}
a token issued by a createStoreonToken function that connects all decorators in a single working system.
a key to extract a value to reflect from the store.
Generated using TypeDoc
This module provides a Storeon connector for web components.