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

@nanostores/query

Package Overview
Dependencies
Maintainers
4
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.1.3 to 0.2.0

9

package.json
{
"name": "@nanostores/query",
"version": "0.1.3",
"version": "0.2.0",
"description": "Tiny remote data fetching library for Nano Stores",

@@ -44,4 +44,11 @@ "scripts": {

"@evilmartians/lefthook": "^1.2.6",
"@nanostores/react": "^0.7.1",
"@rollup/plugin-strip": "^3.0.2",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.7",
"@types/react-dom": "^18.2.4",
"happy-dom": "^9.20.3",
"nanostores": "^0.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.9.4",

@@ -48,0 +55,0 @@ "vite": "^3.0.4",

11

README.md

@@ -51,3 +51,3 @@ # Nano Stores Query

export const [createFetcherStore, createMutatorStore] = nanoquery({
fetcher: (...keys: string[]) => fetch(keys.join('')).then((r) => r.json()),
fetcher: (...keys: (string | number)[]) => fetch(keys.join('')).then((r) => r.json()),
});

@@ -89,6 +89,9 @@ ```

It accepts two arguments: **key** and **fetcher options**.
It accepts two arguments: **key input** and **fetcher options**.
```ts
type KeyParts = undefined | Array<ReadableAtom<string | null | undefined> | string>
type NoKey = null | undefined | void;
type SomeKey = string | number;
type KeyInput = SomeKey | Array<SomeKey | ReadableAtom<SomeKey | NoKey>>;
```

@@ -104,3 +107,3 @@

// The async function that actually returns the data
fetcher?: (...keyParts: string[]) => Promise<unknown>;
fetcher?: (...keyParts: (string | number)[]) => Promise<unknown>;
// How much time should pass between running fetcher for the exact same key parts

@@ -107,0 +110,0 @@ // default = 4s

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