Edit this page

up.Layer up.Layer.prototype.asCurrent(fn)
Class method

This feature is experimental. Please share your experiences so we know what to keep or change.

Temporarily changes the current layer while the given function is running.

Calls the given function and restores the original current layer when the function terminates.


Parameters

fn Function()

The synchronous function to call.

Async functions are not supported.