mirror of https://github.com/Budibase/budibase.git
committed by
GitHub
6 changed files with 29 additions and 8 deletions
@ -1,7 +1,5 @@ |
|||
export { createAPIClient } from "./api" |
|||
export { createLocalStorageStore } from "./stores/localStorage" |
|||
export { fetchData } from "./fetch/fetchData" |
|||
export * as Constants from "./constants" |
|||
export * as LuceneUtils from "./utils/lucene" |
|||
export * as JSONUtils from "./utils/json" |
|||
export * as CookieUtils from "./utils/cookies" |
|||
export * from "./stores" |
|||
export * from "./utils" |
|||
|
|||
@ -0,0 +1 @@ |
|||
export { createLocalStorageStore } from "./localStorage" |
|||
@ -0,0 +1,4 @@ |
|||
export * as LuceneUtils from "./lucene" |
|||
export * as JSONUtils from "./json" |
|||
export * as CookieUtils from "./cookies" |
|||
export * as Utils from "./utils" |
|||
@ -0,0 +1,17 @@ |
|||
/** |
|||
* Utility to wrap an async function and ensure all invocations happen |
|||
* sequentially. |
|||
* @param fn the async function to run |
|||
* @return {Promise} a sequential version of the function |
|||
*/ |
|||
export const sequential = fn => { |
|||
let promise |
|||
return async (...params) => { |
|||
if (promise) { |
|||
await promise |
|||
} |
|||
promise = fn(...params) |
|||
await promise |
|||
promise = null |
|||
} |
|||
} |
|||
Loading…
Reference in new issue