φ Famo.us University Famo.us/Angular Docs Help Blog Download
  • core
  • Context
  • ElementAllocator
  • ElementOutput
  • Engine
  • Entity
  • EventEmitter
  • EventHandler
  • Group
  • Modifier
  • OptionsManager
  • RenderNode
  • Scene
  • SpecParser
  • Transform
  • View
  • ViewSequence
  • events
  • EventArbiter
  • EventFilter
  • EventMapper
  • inputs
  • Accumulator
  • GenericSync
  • MouseSync
  • PinchSync
  • RotateSync
  • ScaleSync
  • ScrollSync
  • TouchSync
  • TouchTracker
  • TwoFingerSync
  • math
  • Matrix
  • Quaternion
  • Random
  • Utilities
  • Vector
  • modifiers
  • Draggable
  • Fader
  • ModifierChain
  • StateModifier
  • physics
  • PhysicsEngine
  • physics/bodies
  • Body
  • Circle
  • Particle
  • Rectangle
  • physics/constraints
  • Surface
  • Collision
  • Constraint
  • Curve
  • Distance
  • Snap
  • Wall
  • Walls
  • physics/forces
  • Drag
  • Force
  • Repulsion
  • RotationalDrag
  • RotationalSpring
  • Spring
  • VectorField
  • physics/integrators
  • SymplecticEuler
  • surfaces
  • CanvasSurface
  • ContainerSurface
  • ImageSurface
  • InputSurface
  • TextareaSurface
  • VideoSurface
  • transitions
  • CachedMap
  • Easing
  • MultipleTransition
  • SnapTransition
  • SpringTransition
  • Transitionable
  • TransitionableTransform
  • TweenTransition
  • WallTransition
  • utilities
  • KeyCodes
  • Timer
  • Utility
  • views
  • ContextualView
  • Deck
  • DrawerLayout
  • EdgeSwapper
  • FlexibleLayout
  • Flipper
  • GridLayout
  • HeaderFooterLayout
  • Lightbox
  • RenderController
  • ScrollContainer
  • Scroller
  • Scrollview
  • SequentialLayout
  • widgets
  • NavigationBar
  • TabBar

Timer

An internal library to reproduce javascript time-based scheduling. Using standard javascript setTimeout methods can have a negative performance impact when combined with the Famous rendering process, so instead require Timer and call Timer.setTimeout, Timer.setInterval, etc.

Overview

Methods
addTimerFunction
setTimeout
setInterval
after
every
clear
debounce
Methods

addTimerFunction(fn)

Add a function to be run on every prerender

Parameters
fn
Function
function to be run every prerender
Returns
Function
function passed in as parameter

setTimeout(fn, duration)

Wraps a function to be invoked after a certain amount of time. After a set duration has passed, it executes the function and removes it as a listener to 'prerender'.

Parameters
fn
Function
function to be run after a specified duration
duration
Number
milliseconds from now to execute the function
Returns
Function
function passed in as parameter

setInterval(fn, duration)

Wraps a function to be invoked after a certain amount of time. After a set duration has passed, it executes the function and resets the execution time.

Parameters
fn
Function
function to be run after a specified duration
duration
Number
interval to execute function in milliseconds
Returns
Function
function passed in as parameter

after(fn, numTicks)

Wraps a function to be invoked after a certain amount of prerender ticks. Similar use to setTimeout but tied to the engine's run speed.

Parameters
fn
Function
function to be run after a specified amount of ticks
numTicks
Number
number of prerender frames to wait
Returns
Function
function passed in as parameter

every(fn, numTicks)

Wraps a function to be continually invoked after a certain amount of prerender ticks. Similar use to setInterval but tied to the engine's run speed.

Parameters
fn
Function
function to be run after a specified amount of ticks
numTicks
Number
number of prerender frames to wait
Returns
Function
function passed in as parameter

clear(fn)

Remove a function that gets called every prerender

Parameters
fn
Function
event linstener

debounce(func, wait)

Executes a function after a certain amount of time. Makes sure the function is not run multiple times.

Parameters
func
Function
function to run after certain amount of time
wait
Number
amount of time
Returns
Function
function that is not able to debounce
Branding Terms Privacy Jobs © Famous Industries, Inc. 2015