Explorar o código

Document workspace debounce interval.

Afshin Darian %!s(int64=7) %!d(string=hai) anos
pai
achega
d064ed8020
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  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);
       }
     });