Skip to content

Group your AnimationFrames by priority and stage (read, write).

Notifications You must be signed in to change notification settings

nathanaelsousa/myFrame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

myFrame

requestAnimationFrame with steroids. It is meant to help on progressive loading a web page, showing content to the user as soon as possible.

myFrame.onResponse(function, stage)
 Request to call a function in the response frame.
   function
     The function to be called.
   stage
     The stage which the function will be called.
     "read" | "write" defaults to "write".
     Functions in the read stage are called first so recalculate Style is not forced.

myFrame.onNext(function, stage)
 Request to call a function in the nextframe, which is the frame just after the response frame.
 Works equals requestReponse().

myFrame.onLast(function, stage)
 Request to call a function in the lastframe, which is the frame executed just after all the next frames are.
 Works equals requestReponse().

*If you request a frame in a function already running inside a frame and the requested frame was previously executed or is executing, a new frame is created and added to the stack of frames left and the stack will be consumed normally according to the priority order.

About

Group your AnimationFrames by priority and stage (read, write).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published