UNPKG

azure-devops-ui

Version:

React components for building web UI in Azure DevOps

23 lines (22 loc) 585 B
/** * Basic ItemProvider that surfaces an array of items through the IItemProvider * interface. */ export class ArrayItemProvider { constructor(items) { this.items = items; } get length() { return this.items.length; } get value() { return this.items; } } /** * Helper function to get the value of a set of items that can be an itemProvider or normal array. * @param items the items to retrieve the value from. */ export function getItemsValue(items) { return Array.isArray(items) ? items : items.value; }