@practicaloptimism/uniplexer
Version:
A multiplexer for 3rd party service providers and application protocols
25 lines (17 loc) • 544 B
text/typescript
import { GetItemList } from '../../../@utility/data-structures/database'
import { storeTable } from '../variables'
import { createItemStore } from './create-item-store'
const getItemList: GetItemList = getItemListFunction
async function getItemListFunction (storeId: string): Promise<any[]> {
if (!storeTable[storeId]) {
await createItemStore(storeId)
}
const resultList: any[] = []
await storeTable[storeId].iterate((value: any, _: string) => {
resultList.push(value)
})
return resultList
}
export {
getItemList
}