personal web client for Bluesky
typescript solidjs bluesky atcute
at trunk 3.6 kB view raw
1diff --git a/build/modern/_notifyManager.js b/build/modern/_notifyManager.js 2new file mode 100644 3index 0000000000000000000000000000000000000000..a8dec3a4b959a30571de9f690a1ffeda8815a191 4--- /dev/null 5+++ b/build/modern/_notifyManager.js 6@@ -0,0 +1,15 @@ 7+export var batch = (callback) => callback(); 8+ 9+export var batchCalls = (callback) => { 10+ return (...args) => batch(() => callback(...args)); 11+}; 12+ 13+export var schedule = (callback) => callback(); 14+ 15+export var setNotifyFunction = () => {}; 16+ 17+export var setBatchNotifyFunction = (fn) => { 18+ batch = fn; 19+}; 20+ 21+export var setScheduler = () => {}; 22diff --git a/build/modern/notifyManager.js b/build/modern/notifyManager.js 23index bb5d0317ae0f1aacc7d5229457ce22adfef71655..9c113b5826ba5fe927acd3e8dafe19900794a8ef 100644 24--- a/build/modern/notifyManager.js 25+++ b/build/modern/notifyManager.js 26@@ -1,77 +1,9 @@ 27 // src/notifyManager.ts 28+import * as notifyManager from "./_notifyManager.js"; 29+ 30 function createNotifyManager() { 31- let queue = []; 32- let transactions = 0; 33- let notifyFn = (callback) => { 34- callback(); 35- }; 36- let batchNotifyFn = (callback) => { 37- callback(); 38- }; 39- let scheduleFn = (cb) => setTimeout(cb, 0); 40- const setScheduler = (fn) => { 41- scheduleFn = fn; 42- }; 43- const batch = (callback) => { 44- let result; 45- transactions++; 46- try { 47- result = callback(); 48- } finally { 49- transactions--; 50- if (!transactions) { 51- flush(); 52- } 53- } 54- return result; 55- }; 56- const schedule = (callback) => { 57- if (transactions) { 58- queue.push(callback); 59- } else { 60- scheduleFn(() => { 61- notifyFn(callback); 62- }); 63- } 64- }; 65- const batchCalls = (callback) => { 66- return (...args) => { 67- schedule(() => { 68- callback(...args); 69- }); 70- }; 71- }; 72- const flush = () => { 73- const originalQueue = queue; 74- queue = []; 75- if (originalQueue.length) { 76- scheduleFn(() => { 77- batchNotifyFn(() => { 78- originalQueue.forEach((callback) => { 79- notifyFn(callback); 80- }); 81- }); 82- }); 83- } 84- }; 85- const setNotifyFunction = (fn) => { 86- notifyFn = fn; 87- }; 88- const setBatchNotifyFunction = (fn) => { 89- batchNotifyFn = fn; 90- }; 91- return { 92- batch, 93- batchCalls, 94- schedule, 95- setNotifyFunction, 96- setBatchNotifyFunction, 97- setScheduler 98- }; 99+ return notifyManager; 100 } 101-var notifyManager = createNotifyManager(); 102-export { 103- createNotifyManager, 104- notifyManager 105-}; 106+ 107+export { createNotifyManager, notifyManager }; 108 //# sourceMappingURL=notifyManager.js.map 109diff --git a/build/modern/utils.js b/build/modern/utils.js 110index 0e93a35b45cfc2d53fc17120c741a91ec8a8c533..82b51475e4e12860552f4a0f5f3af23f416740fa 100644 111--- a/build/modern/utils.js 112+++ b/build/modern/utils.js 113@@ -140,21 +140,12 @@ function isPlainArray(value) { 114 return Array.isArray(value) && value.length === Object.keys(value).length; 115 } 116 function isPlainObject(o) { 117- if (!hasObjectPrototype(o)) { 118+ if (typeof o !== "object" || o === null) { 119 return false; 120 } 121- const ctor = o.constructor; 122- if (typeof ctor === "undefined") { 123- return true; 124- } 125- const prot = ctor.prototype; 126- if (!hasObjectPrototype(prot)) { 127- return false; 128- } 129- if (!prot.hasOwnProperty("isPrototypeOf")) { 130- return false; 131- } 132- return true; 133+ 134+ const proto = Object.getPrototypeOf(o); 135+ return (proto === null || proto === Object.prototype) && Object.isExtensible(o); 136 } 137 function hasObjectPrototype(o) { 138 return Object.prototype.toString.call(o) === "[object Object]";