Пример #1
0
 static start() {
   if (! QueryIDB.canIUse()) return Promise.resolve();
   stops.push(
     Query.onAnyChange((now, was, flag) => {
       if (flag === 'stopped') return;
       const doc = (now == null ? was : now);
       const model = doc.constructor;
       const action = monitor[model.modelName];
       if (action !== undefined) action(now, was);
     }).stop,
   );
   idb = new IDB();
   const rpcQueue = new RPCIDBQueue(idb);
   ClientRpcBase(session, {rpcQueue});
   return idb.whenReady(() => {
     rpcQueue.reload(session);
   });
 }
Пример #2
0
 static stop() {
   if (! QueryIDB.canIUse()) return false;
   stops.forEach(stop => {stop()});
   stops = [];
   idb = null;
 }