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

@preact-signals/query

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@preact-signals/query - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

14

CHANGELOG.md
# @preact-signals/query
## 1.0.3
### Patch Changes
- d2705bf: Fixed installation for preact in readme
- Updated dependencies [7694443]
- Updated dependencies [d2705bf]
- Updated dependencies [e9a5fef]
- Updated dependencies [ba769ed]
- Updated dependencies [e9a5fef]
- Updated dependencies [7dacde0]
- Updated dependencies [9db73dd]
- @preact-signals/utils@0.4.0
## 1.0.2

@@ -4,0 +18,0 @@

4

dist/cjs/react-query/QueryClientProvider.js

@@ -28,3 +28,2 @@ "use strict";

exports.QueryClientProvider = exports.useQueryClient$ = exports.useQueryClient = exports.defaultContext = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const React = __importStar(require("react"));

@@ -82,5 +81,6 @@ const hooks_1 = require("@preact-signals/utils/hooks");

const Context = getQueryClientContext(context, contextSharing);
return ((0, jsx_runtime_1.jsx)(QueryClientSharingContext.Provider, { value: !context && contextSharing, children: (0, jsx_runtime_1.jsx)(Context.Provider, { value: client, children: children }) }));
return (React.createElement(QueryClientSharingContext.Provider, { value: !context && contextSharing },
React.createElement(Context.Provider, { value: client }, children)));
};
exports.QueryClientProvider = QueryClientProvider;
//# sourceMappingURL=QueryClientProvider.js.map

@@ -28,3 +28,2 @@ "use strict";

exports.QueryErrorResetBoundary = exports.useQueryErrorResetBoundary = exports.useQueryErrorResetBoundary$ = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const hooks_1 = require("@preact-signals/utils/hooks");

@@ -54,7 +53,7 @@ const React = __importStar(require("react"));

const [value] = React.useState(() => createValue());
return ((0, jsx_runtime_1.jsx)(QueryErrorResetBoundaryContext.Provider, { value: value, children: typeof children === "function"
? children(value)
: children }));
return (React.createElement(QueryErrorResetBoundaryContext.Provider, { value: value }, typeof children === "function"
? children(value)
: children));
};
exports.QueryErrorResetBoundary = QueryErrorResetBoundary;
//# sourceMappingURL=QueryErrorResetBoundary.js.map
import type { ReadonlySignal } from "@preact-signals/unified-signals";
import { ReadonlyFlatStore } from "@preact-signals/utils/flat-store";
import { ReadonlyFlatStore } from "@preact-signals/utils";
type Dispose = () => void;

@@ -9,3 +9,3 @@ type Observer<T> = {

export declare const useObserverSignal: <T>(createObserver: () => Observer<T>) => ReadonlySignal<T>;
export declare const useObserverStore: <T extends Record<any, any>>(createObserverStore: () => Observer<T>) => Readonly<import("@preact-signals/utils/flat-store").FlatStore<T>>;
export declare const useObserverStore: <T extends Record<any, any>>(createObserverStore: () => Observer<T>) => Readonly<import("@preact-signals/utils").FlatStore<T>>;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useObserverStore = exports.useObserverSignal = void 0;
const flat_store_1 = require("@preact-signals/utils/flat-store");
const hooks_1 = require("@preact-signals/utils/hooks");

@@ -20,3 +19,3 @@ const useObserverSignal = (createObserver) => {

const observer = (0, hooks_1.useSignalOfReactive)(createObserverStore);
const [store, setStore] = (0, flat_store_1.useStore)(() => observer.value.getCurrent());
const [store, setStore] = (0, hooks_1.useStore)(() => observer.value.getCurrent());
(0, hooks_1.useSignalEffectOnce)(() => {

@@ -23,0 +22,0 @@ setStore(observer.value.getCurrent());

"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import * as React from "react";

@@ -53,4 +52,5 @@ import { useSignalOfState } from "@preact-signals/utils/hooks";

const Context = getQueryClientContext(context, contextSharing);
return (_jsx(QueryClientSharingContext.Provider, { value: !context && contextSharing, children: _jsx(Context.Provider, { value: client, children: children }) }));
return (React.createElement(QueryClientSharingContext.Provider, { value: !context && contextSharing },
React.createElement(Context.Provider, { value: client }, children)));
};
//# sourceMappingURL=QueryClientProvider.js.map
"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import { useSignalContext } from "@preact-signals/utils/hooks";

@@ -25,6 +24,6 @@ import * as React from "react";

const [value] = React.useState(() => createValue());
return (_jsx(QueryErrorResetBoundaryContext.Provider, { value: value, children: typeof children === "function"
? children(value)
: children }));
return (React.createElement(QueryErrorResetBoundaryContext.Provider, { value: value }, typeof children === "function"
? children(value)
: children));
};
//# sourceMappingURL=QueryErrorResetBoundary.js.map
import type { ReadonlySignal } from "@preact-signals/unified-signals";
import { ReadonlyFlatStore } from "@preact-signals/utils/flat-store";
import { ReadonlyFlatStore } from "@preact-signals/utils";
type Dispose = () => void;

@@ -9,3 +9,3 @@ type Observer<T> = {

export declare const useObserverSignal: <T>(createObserver: () => Observer<T>) => ReadonlySignal<T>;
export declare const useObserverStore: <T extends Record<any, any>>(createObserverStore: () => Observer<T>) => Readonly<import("@preact-signals/utils/flat-store").FlatStore<T>>;
export declare const useObserverStore: <T extends Record<any, any>>(createObserverStore: () => Observer<T>) => Readonly<import("@preact-signals/utils").FlatStore<T>>;
export {};

@@ -1,3 +0,2 @@

import { useStore } from "@preact-signals/utils/flat-store";
import { useInitSignal, useSignalEffectOnce, useSignalOfReactive, } from "@preact-signals/utils/hooks";
import { useInitSignal, useSignalEffectOnce, useSignalOfReactive, useStore, } from "@preact-signals/utils/hooks";
export const useObserverSignal = (createObserver) => {

@@ -4,0 +3,0 @@ const observer = useSignalOfReactive(createObserver);

{
"name": "@preact-signals/query",
"version": "1.0.2",
"version": "1.0.3",
"private": false,

@@ -67,3 +67,3 @@ "publishConfig": {

"use-sync-external-store": "^1.2.0",
"@preact-signals/utils": "0.3.0",
"@preact-signals/utils": "0.4.0",
"@preact-signals/unified-signals": "0.2.0"

@@ -70,0 +70,0 @@ },

@@ -24,6 +24,7 @@ # `@preact-signals/query`

```
### `@preact/signals` additional step:
You should resolve `@preact/signals-react` as `@preact/signals`
To do it take a look at how to [resolve `react` as `preact`](https://preactjs.com/guide/v10/getting-started#aliasing-react-to-preact) and do it with signals
To do it take a look at how to [resolve `react` as `preact`](https://preactjs.com/guide/v10/getting-started#aliasing-react-to-preact) and do it with signals. Plus you need to dedupe `preact`

@@ -40,2 +41,4 @@ #### [Vite example](../../apps/preact-test/vite.config.ts):

resolve: {
// add this line
dedupe: ["preact"],
alias: [

@@ -46,2 +49,3 @@ { find: "react", replacement: "preact/compat" },

{ find: "react/jsx-runtime", replacement: "preact/jsx-runtime" },
// add this line
{ find: "@preact/signals-react", replacement: "@preact/signals" },

@@ -48,0 +52,0 @@ ],

import type { ReadonlySignal } from "@preact-signals/unified-signals";
import { ReadonlyFlatStore, useStore } from "@preact-signals/utils/flat-store";
import { ReadonlyFlatStore } from "@preact-signals/utils";
import {

@@ -7,2 +7,3 @@ useInitSignal,

useSignalOfReactive,
useStore,
} from "@preact-signals/utils/hooks";

@@ -9,0 +10,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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