Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nanostores/query

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nanostores/query - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

8

dist/factory.d.ts

@@ -74,2 +74,10 @@ import { PlatformCompat } from './platforms/type';

};
/**
* This piece of shenanigans is copy-pasted from SWR. God be my witness I don't like
* all this bitwise shifting operations as they are absolutely unclear, but I'm
* ok to compact the code a bit.
*/
export declare function defaultOnErrorRetry({ retryCount }: {
retryCount: number;
}): number;
export declare const nanoqueryFactory: ([isAppVisible, visibilityChangeSubscribe, reconnectChangeSubscribe,]: PlatformCompat) => ({ cache, fetcher: globalFetcher, ...globalSettings }?: NanoqueryArgs) => readonly [<T = unknown, E = any>(keyInput: KeyInput, { fetcher, ...fetcherSettings }?: CommonSettings<T>) => FetcherStore<T, E>, <Data = void, Result = unknown, E_1 = any>(mutator: ManualMutator<Data, Result>, opts?: {

@@ -76,0 +84,0 @@ throttleCalls?: boolean;

1

dist/main.d.ts
export type { KeyInput, KeySelector, Fetcher, OnErrorRetry, CommonSettings, NanoqueryArgs, FetcherValue, FetcherStore, FetcherStoreCreator, ManualMutator, MutateCb, MutatorStore, } from './factory';
export { defaultOnErrorRetry as onErrorRetry } from './factory';
export declare const nanoquery: ({ cache, fetcher: globalFetcher, ...globalSettings }?: import('./factory').NanoqueryArgs) => readonly [<T = unknown, E = any>(keyInput: import('./factory').KeyInput, { fetcher, ...fetcherSettings }?: import('./factory').CommonSettings<T>) => import('./factory').FetcherStore<T, E>, <Data = void, Result = unknown, E_1 = any>(mutator: import('./factory').ManualMutator<Data, Result>, opts?: {

@@ -3,0 +4,0 @@ throttleCalls?: boolean | undefined;

17

dist/nanoquery.js
import { map, onStart, onStop, atom, batched, startTask } from 'nanostores';
import { createNanoEvents } from 'nanoevents';
function defaultOnErrorRetry({ retryCount }) {
return ~~((Math.random() + 0.5) * (1 << (retryCount < 8 ? retryCount : 8))) * 2e3;
}
const nanoqueryFactory = ([

@@ -106,3 +109,6 @@ isAppVisible,

key,
setTimeout(() => invalidateKeys(key), timer)
setTimeout(() => {
invalidateKeys(key);
cache.set(key, { retryCount });
}, timer)
);

@@ -151,5 +157,5 @@ }

const unsub = fetcherStore.listen(({ error, data }) => {
if (error)
if (error !== void 0)
resolve({ error });
if (data)
if (data !== void 0)
resolve({ data });

@@ -391,5 +397,2 @@ });

};
function defaultOnErrorRetry({ retryCount }) {
return ~~((Math.random() + 0.5) * (1 << (retryCount < 8 ? retryCount : 8))) * 2e3;
}
function noop() {

@@ -426,2 +429,2 @@ }

export { nanoquery };
export { nanoquery, defaultOnErrorRetry as onErrorRetry };
{
"name": "@nanostores/query",
"version": "0.3.3",
"version": "0.3.4",
"description": "Tiny remote data fetching library for Nano Stores",

@@ -5,0 +5,0 @@ "scripts": {

@@ -298,3 +298,4 @@ # Nano Stores Query

- it will execute against currently set keys (no way to customize them for the call);
- it will still leverage deduplication.
- it will still leverage deduplication;
- underlying fetcher function cannot resolve or reject with `undefined` as their value. This will lead to hanging promises.

@@ -301,0 +302,0 @@ ### Dependencies, but not in keys

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc