Add supporting themes required for Lotusdocs
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// @flow
|
||||
|
||||
export default function debounce<T>(fn: Function): () => Promise<T> {
|
||||
let pending;
|
||||
return () => {
|
||||
if (!pending) {
|
||||
pending = new Promise<T>(resolve => {
|
||||
Promise.resolve().then(() => {
|
||||
pending = undefined;
|
||||
resolve(fn());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return pending;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user