Tutorial: ColumnOrRow.getAdjacentStacks

ColumnOrRow.getAdjacentStacks

Retrieves the adjacent TabStacks of the given ColumnOrRow

Get adjacent tab stacks

if (!fin.me.isView) {
    throw new Error('Not running in a platform View.');
}

const stack = await fin.me.getCurrentStack();
const columnOrRow = await stack.getParent();
// Possible position inputs: 'right' | 'left' | 'top' | 'bottom'
const rightStacks = await columnOrRow.getAdjacentStacks('right');
const leftStacks = await columnOrRow.getAdjacentStacks('left');

console.log(`The ColumnOrRow has ${rightStacks.length} stacks to the right, and ${leftStacks.length} stacks to the left`);