본문으로 건너뛰기

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

events

readonly (keyof Events)[]

If you want to use events, write the events property and a way to register/unregister events.

methods

methods

readonly Methods[]

[]

If you want to use an instance's method, write the method names.

state

state

State

Specify if you want to use the framework's state. If an instance is created through created, it can be omitted.

Methods

created

created

undefined | 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

Props

data

data

Props

data(): Props

Description You

can decide which props to pass when creating/destroying instances in the framework.

destroy

destroy

void

destroy(instance: Instance, props: Props): void

Occurs before the component is destroyed.

Parameters

instance

Instance

props

Props

init

init

void

init(instance: Instance, props: Props): void

Occurs after mount, state declaration, and observation in the component.

Parameters

instance

Instance

props

Props

mounted

mounted

undefined | void | Instance

mounted(props: Props, instance: null | Instance): undefined | void | Instance

Occurs when a component is mounted.

Parameters

props

Props

instance

null | Instance

off

off

void

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

Instance

eventName

EventName

listener

ReactiveEventCallback<Events, EventName>

on

on

void | (() => 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

Instance

eventName

EventName

listener

ReactiveEventCallback<Events, EventName>

props

props

Props

props(): Props

You can decide which data to pass when creating/destroying instances in the framework.

setup

setup

undefined | 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

setup

ReactiveSetup<Instance, State, Methods, Props, Events>