Home Reference Source
import TimersDashboard from 'timer_app/src/components/TimersDashboard.js'
public class | source

TimersDashboard

Extends:

react~React.Component → TimersDashboard

This is the main component, it shows a list of editable timers and a button/box to create a new timer It also handle all the logic and communication with the server

Static Method Summary

Static Public Methods
public static

byId(searched_id: string): function(arg: {id: string}): boolean

Return a function for filter/find in an array an element with the specified id

Member Summary

Public Members
public

Ref of the setInterval This variable is used to clear the interval when the element is unmounted

Method Summary

Public Methods
public

Reload the data from the server every 5s

public

Stop loading the data from the server

public

Create a new timer

public

deleteTimer(timerId: string)

Delete the specified timerId from the server

public

render(): XML

Render

public

startTimer(timerId: string)

Start a timer

public

stopTimer(timerId: string)

Stop a timer

public

Update a timer

public

Update a timer using the defined id

Static Public Methods

public static byId(searched_id: string): function(arg: {id: string}): boolean source

Return a function for filter/find in an array an element with the specified id

Params:

NameTypeAttributeDescription
searched_id string

Return:

function(arg: {id: string}): boolean

Public Members

public ajaxInterval: number source

Ref of the setInterval This variable is used to clear the interval when the element is unmounted

Public Methods

public componentDidMount() source

Reload the data from the server every 5s

public componentWillUnmount() source

Stop loading the data from the server

public createTimer(timer: APITimer) source

Create a new timer

Params:

NameTypeAttributeDescription
timer APITimer

public deleteTimer(timerId: string) source

Delete the specified timerId from the server

Params:

NameTypeAttributeDescription
timerId string

public render(): XML source

Render

Return:

XML

public startTimer(timerId: string) source

Start a timer

Params:

NameTypeAttributeDescription
timerId string

public stopTimer(timerId: string) source

Stop a timer

Params:

NameTypeAttributeDescription
timerId string

public updateTimer(attrs: APITimer) source

Update a timer

Params:

NameTypeAttributeDescription
attrs APITimer

public updateTimerById(id: string, attrs: APITimer) source

Update a timer using the defined id

Params:

NameTypeAttributeDescription
id string
attrs APITimer