Interface: IComponent<S>
Type parameters
Name | Type |
---|---|
S | any |
Implemented by
Methods
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Defined in
getState
▸ getState(): S
Get the Component state
Returns
S
Defined in
onUpdateState
▸ onUpdateState(listener
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
listener | (prevState : S , nextState : S ) => void |
Returns
void
Defined in
removeOnUpdateState
▸ removeOnUpdateState(listener?
): void
Remove the Component update event listening, default is remove all, also you can remove one by pass the listener
Parameters
Name | Type |
---|---|
listener? | Function |
Returns
void
Defined in
render
▸ render(nextState?
): void
Trigger the Component update event
Parameters
Name | Type |
---|---|
nextState? | S |
Returns
void
Defined in
setState
▸ setState(values
, callback?
): void
Set the Component state
Parameters
Name | Type | Description |
---|---|---|
values | S | The next values of state |
callback? | (prevState : S , nextState : S ) => void | calling after setState |
Returns
void