Since

0.1

Timer allows you to create, start and clear timers.

Example

import Button from '@smartface/native/ui/button'
import Timer from '@smartface/native/timer';
var myButton = new Button({
onPress: setTimer
});

function setTimer() {
var myTimer = Timer.setTimeout({
task: changeBackgroundColor,
delay: 3000
});
}

import Color from '@smartface/native/ui/color';
function changeBackgroundColor() {
myButton.backgroundColor = Color.RED;
}

Hierarchy

  • ITimer

Methods

  • Method

    setTimeout

    Calls a function after a spesified time elapses.

    Static

    Since

    0.1

    Parameters

    Returns number

  • Method

    setInterval

    Calls a function repeatedly after a spesified time elapses.

    Static

    Since

    0.1

    Parameters

    Returns number

  • Method

    clearTimer

    Clears a specified Timer instance.

    Static

    Since

    0.1

    Parameters

    • timerId: number

    Returns void

  • Method

    clearAllTimer

    Clears all the Timers.

    Static

    Since

    0.1

    Returns void

Generated using TypeDoc