瀏覽代碼

Document workspace debounce interval.

Afshin Darian 7 年之前
父節點
當前提交
d064ed8020
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      packages/apputils-extension/src/index.ts

+ 9 - 1
packages/apputils-extension/src/index.ts

@@ -42,6 +42,14 @@ import {
 import '../style/index.css';
 
 
+/**
+ * The interval in milliseconds that calls to save a workspace are debounced
+ * to allow for multiple quickly executed state changes to result in a single
+ * workspace save operation.
+ */
+const WORKSPACE_SAVE_DEBOUNCE_INTERVAL = 2000;
+
+
 /**
  * The command IDs used by the apputils plugin.
  */
@@ -267,7 +275,7 @@ const state: JupyterLabPlugin<IStateDB> = {
             .catch(reason => {
               console.warn(`Saving workspace (${id}) failed.`, reason);
             });
-        }, 2000);
+        }, WORKSPACE_SAVE_DEBOUNCE_INTERVAL);
       }
     });