UNPKG

@practicaloptimism/uniplexer

Version:

A multiplexer for 3rd party service providers and application protocols

17 lines (14 loc) 430 B
async function updateState (_stateId: string, _value: any): Promise<any> { // if (!stateTable[stateId]) { // stateTable[stateId] = { value, listenerList: [] } // } else { // stateTable[stateId].value = value // } // for (let i = 0; i < stateTable[stateId].listenerList.length; i++) { // stateTable[stateId].listenerList[i]() // } // return Promise.resolve(stateTable[stateId]) } export { updateState }