ReactiveSetup
Function type Reactive Adapter's first argument setup
interface ReactiveSetup<Instance extends [ReactiveSubscribe](../../Reactive-Decorator/Function/ReactiveSubscribe)<Record>, State extends Record<string, any> = [ReactiveState](../Type/ReactiveState)<Instance>, Methods extends keyof Partial<Instance> = never, Props = any, Events extends Record<string, any> = {}>
Methods
Trigger events directly externally.
Get external props.
Register events defined between Mounted and Init Lifecycle.
Register hooks to occur in Destroy Lifecycle.
Register hooks to occur in Init Lifecycle.
Register hooks that will occur in Mounted Lifecycle.
Set the events to be exposed.
Set the first Initial state.
Do not set the return value if it exists.
Sets the functions to be exposed in the instance.
Methods
emit
emitvoid
emit<EventName>(eventName: EventName, ...params: EventTriggerParams<Events, EventName>): void
Trigger events directly externally.
Parameters
EventName
EventTriggerParams<Events, EventName>
getProps
getPropsProps
getProps(): Props
Get external props.
on
onvoid
on(callback: (<EventName>(instance: Instance, eventName: EventName, listener: ReactiveEventCallback<Events, EventName>) => void | (() => void))): void
Register events defined between Mounted and Init Lifecycle.
Parameters
(<EventName>(instance: Instance, eventName: EventName, listener: ReactiveEventCallback<Events, EventName>) => void | (() => void))
onDestroy
onDestroyvoid
onDestroy(callback: ((instance: Instance, props: Props) => void)): void
Register hooks to occur in Destroy Lifecycle.
Parameters
((instance: Instance, props: Props) => void)
onInit
onInitvoid
onInit(callback: ((instance: Instance, props: Props) => void)): void
Register hooks to occur in Init Lifecycle.
Parameters
((instance: Instance, props: Props) => void)
onMounted
onMountedvoid
onMounted(callback: ((props: Props, instance: null | Instance) => void | Instance)): void
Register hooks that will occur in Mounted Lifecycle.
Parameters
((props: Props, instance: null | Instance) => void | Instance)
setEvents
setEventsvoid
setEvents(events: readonly (keyof Events)[]): void
Set the events to be exposed.
Parameters
readonly (keyof Events)[]
setInitialState
setInitialStatevoid
setInitialState(state: State): void
Set the first Initial state.
Do not set the return value if it exists.
Parameters
State
setMethods
setMethodsvoid
setMethods(methods: readonly Methods[]): void
Sets the functions to be exposed in the instance.
Parameters
readonly Methods[]