Tutorial: Layout.wrapSync

Layout.wrapSync

Synchronously 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 = fin.Platform.Layout.wrapSync(windowIdentity);
// Use wrapped instance to control layout, e.g.:
const layoutConfig = await layout.getConfig();