@nanostores/query
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -1,2 +0,2 @@ | ||
import { map, onStart, onStop, atom } from "nanostores"; | ||
import { map, onStart, onStop, atom, startTask } from "nanostores"; | ||
import { createNanoEvents } from "nanoevents"; | ||
@@ -10,7 +10,6 @@ const nanoquery = ({ | ||
let focus = true; | ||
subscribe("focus", () => { | ||
focus = true; | ||
events.emit(FOCUS); | ||
subscribe("visibilitychange", () => { | ||
focus = !document.hidden; | ||
focus && events.emit(FOCUS); | ||
}); | ||
subscribe("blur", () => focus = false); | ||
subscribe("online", () => events.emit(RECONNECT)); | ||
@@ -55,2 +54,3 @@ const _refetchOnInterval = /* @__PURE__ */ new Map(), _lastFetch = /* @__PURE__ */ new Map(), _runningFetches = /* @__PURE__ */ new Map(); | ||
} | ||
const finishTask = startTask(); | ||
try { | ||
@@ -69,2 +69,3 @@ const promise = fetcher(...keyParts); | ||
} finally { | ||
finishTask(); | ||
_runningFetches.delete(key); | ||
@@ -71,0 +72,0 @@ } |
{ | ||
"name": "@nanostores/query", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Tiny remote data fetching library for Nano Stores", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34348
671