Edit this page

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

This feature is experimental. It may be changed or removed in a future version.

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.