0.1
Timer allows you to create, start and clear timers.
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; }
setTimeout
Calls a function after a spesified time elapses.
setInterval
Calls a function repeatedly after a spesified time elapses.
clearTimer
Clears a specified Timer instance.
clearAllTimer
Clears all the Timers.
Generated using TypeDoc
Since
0.1
Timer allows you to create, start and clear timers.
Example