跳到主要内容
版本:0.9.0-beta.2

Interface: IProblemsService

molecule.IProblemsService

Hierarchy

Implemented by

Properties

state

Protected Abstract state: IProblems<any>

Inherited from

Component.state

Defined in

src/react/component.ts:42

Methods

add

add(data): void

Add single or multiple items data

Parameters

NameType
dataIProblemsItem<any> | IProblemsItem<any>[]

Returns

void

Defined in

src/services/problemsService.ts:26


count

count(name): number

Count the service event

Parameters

NameTypeDescription
namestringEvent name

Returns

number

Inherited from

Component.count

Defined in

src/common/event/eventBus.ts:28


emit

emit(name, ...args): void

Emit the service event

Parameters

NameTypeDescription
namestringEvent name
...argsanyArguments

Returns

void

Inherited from

Component.emit

Defined in

src/common/event/eventBus.ts:20


forceUpdate

forceUpdate(): void

Force to update the Component

Returns

void

Inherited from

Component.forceUpdate

Defined in

src/react/component.ts:79


getState

getState(): IProblems<any>

Get the Component state

Returns

IProblems<any>

Inherited from

Component.getState

Defined in

src/react/component.ts:83


onUpdateState

onUpdateState(callback): void

Listen to the Component state update event

Parameters

NameType
callback(prevState: IProblems<any>, nextState: IProblems<any>) => void

Returns

void

Inherited from

Component.onUpdateState

Defined in

src/react/component.ts:71


remove

remove(id): void

Remove the specific problem items

Parameters

NameTypeDescription
idUniqueId | UniqueId[]single or multiple ids

Returns

void

Defined in

src/services/problemsService.ts:31


removeOnUpdateState

removeOnUpdateState(): void

Remove the Component update event listening

Returns

void

Inherited from

Component.removeOnUpdateState

Defined in

src/react/component.ts:75


render

render(nextState?): void

Initiative notify the component to render the view by the state

Parameters

NameType
nextState?IProblems<any>

Returns

void

Inherited from

Component.render

Defined in

src/react/component.ts:67


reset

reset(): void

Reset the ProblemsService state data

Returns

void

Defined in

src/services/problemsService.ts:35


setState

setState(values, callback?): void

Set the state values, and notify the view component to re render

Parameters

NameTypeDescription
valuesPartial<IProblems<any>>update target state values
callback?(prevState: IProblems<any>, nextState: IProblems<any>) => void-

Returns

void

Inherited from

Component.setState

Defined in

src/react/component.ts:54


subscribe

subscribe(name, callback): void

Subscribe the service event

Parameters

NameTypeDescription
namestring | string[]Event name
callbackFunctionCallback function

Returns

void

Inherited from

Component.subscribe

Defined in

src/common/event/eventBus.ts:11


toggleProblems

toggleProblems(): void

Toggle the Problems view between display or hidden

Returns

void

Defined in

src/services/problemsService.ts:44


unsubscribe

unsubscribe(name): void

Unsubscribe the specific event

Parameters

NameTypeDescription
nameanyThe event name

Returns

void

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:37


update

update<T>(data): void

Update the specific data

Type parameters

Name
T

Parameters

NameTypeDescription
dataIProblemsItem<T> | IProblemsItem<T>[]single or multiple problems

Returns

void

Defined in

src/services/problemsService.ts:40