Tutorial: Layout.wrap

Layout.wrap

Asynchronously returns a Layout object that represents an existing Layout.

let windowIdentity;
if (!fin.me.isWindow) {
    windowIdentity = fin.me.identity;
} else if (fin.me.isView) {
    windowIdentity = (await fin.me.getCurrentWindow()).identity;
} else {
    throw new Error('Not running in a platform View or Window');
}

const layout = await fin.Platform.Layout.wrap(windowIdentity);
// Use wrapped instance to control layout, e.g.:
const layoutConfig = await layout.getConfig();