Skip to content

Files

Latest commit

a20a7cc · May 29, 2018

History

History
22 lines (21 loc) · 1.25 KB

README.md

File metadata and controls

22 lines (21 loc) · 1.25 KB

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.