ReactiveAdapter
Object type Reactive Adapter
interface ReactiveAdapter<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> = {}>
Properties
If you want to use events, write the events property and a way to register/unregister events.
If you want to use an instance's method, write the method names.
Specify if you want to use the framework's state. If an instance is created through created, it can be omitted.
Methods
Occurs when a component is created.
If an instance is created and returned, the state specification can be omitted.
Occurs before the component is destroyed.
Occurs after mount, state declaration, and observation in the component.
Occurs when a component is mounted.
If you want to use events, write the events property and a way to register/unregister events.
If you want to use events, write the events property and a way to register/unregister events.
You can decide which data to pass when creating/destroying instances in the framework.
You can use lifecycle hooks functions for setup.
You can omit created, mounted, and init.
Properties
events
eventsreadonly (keyof Events)[]
If you want to use events, write the events property and a way to register/unregister events.
methods
methodsreadonly Methods[]
[]
If you want to use an instance's method, write the method names.
state
stateState
Specify if you want to use the framework's state. If an instance is created through created, it can be omitted.
Methods
created
createdundefined | void | Instance
created(props: Props): undefined | void | Instance
Occurs when a component is created.
If an instance is created and returned, the state specification can be omitted.
Parameters
Props
data
dataProps
data(): Props
Description You
can decide which props to pass when creating/destroying instances in the framework.
destroy
destroyvoid
destroy(instance: Instance, props: Props): void
Occurs before the component is destroyed.
Parameters
Instance
Props
init
initvoid
init(instance: Instance, props: Props): void
Occurs after mount, state declaration, and observation in the component.
Parameters
Instance
Props
mounted
mountedundefined | void | Instance
mounted(props: Props, instance: null | Instance): undefined | void | Instance
Occurs when a component is mounted.
Parameters
Props
null | Instance
off
offvoid
off<EventName>(instance: Instance, eventName: EventName, listener: ReactiveEventCallback<Events, EventName>): void
If you want to use events, write the events property and a way to register/unregister events.
Parameters
Instance
EventName
ReactiveEventCallback<Events, EventName>
on
onvoid | (() => void)
on<EventName>(instance: Instance, eventName: EventName, listener: ReactiveEventCallback<Events, EventName>): void | (() => void)
If you want to use events, write the events property and a way to register/unregister events.
Parameters
Instance
EventName
ReactiveEventCallback<Events, EventName>
props
propsProps
props(): Props
You can decide which data to pass when creating/destroying instances in the framework.
setup
setupundefined | void | Instance
setup(setup: ReactiveSetup<Instance, State, Methods, Props, Events>): undefined | void | Instance
You can use lifecycle hooks functions for setup.
You can omit created, mounted, and init.
Parameters
ReactiveSetup<Instance, State, Methods, Props, Events>