@practicaloptimism/uniplexer
Version:
A multiplexer for 3rd party service providers and application protocols
21 lines (14 loc) • 493 B
text/typescript
import { UpdateItem } from '../../../@utility/data-structures/database'
import { storeTable } from '../variables'
import { createItemStore } from './create-item-store'
const updateItem: UpdateItem = updateItemFunction
async function updateItemFunction (storeId: string, itemId: string, item: any): Promise<any[]> {
if (!storeTable[storeId]) {
await createItemStore(storeId)
}
storeTable[storeId].setItem(itemId, item)
return Promise.resolve([item])
}
export {
updateItem
}