@preact/signals
Advanced tools
Comparing version 1.2.3 to 1.3.0
# @preact/signals | ||
## 1.3.0 | ||
### Minor Changes | ||
- [#578](https://github.com/preactjs/signals/pull/578) [`931404e`](https://github.com/preactjs/signals/commit/931404e96338e120464b73e522148389e38eeb2b) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Allow for passing no argument to the signal and the type to be automatically inferred as `T | undefined` | ||
### Patch Changes | ||
- Updated dependencies [[`931404e`](https://github.com/preactjs/signals/commit/931404e96338e120464b73e522148389e38eeb2b)]: | ||
- @preact/signals-core@1.7.0 | ||
## 1.2.3 | ||
@@ -4,0 +15,0 @@ |
import { signal, computed, batch, effect, Signal, type ReadonlySignal, untracked } from "@preact/signals-core"; | ||
export { signal, computed, batch, effect, Signal, type ReadonlySignal, untracked, }; | ||
export declare function useSignal<T>(value: T): Signal<T>; | ||
export declare function useSignal<T = undefined>(): Signal<T | undefined>; | ||
export declare function useComputed<T>(compute: () => T): ReadonlySignal<T>; | ||
@@ -5,0 +6,0 @@ export declare function useSignalEffect(cb: () => void | (() => void)): void; |
{ | ||
"name": "@preact/signals", | ||
"version": "1.2.3", | ||
"version": "1.3.0", | ||
"license": "MIT", | ||
@@ -44,3 +44,3 @@ "description": "Manage state with style in Preact", | ||
"dependencies": { | ||
"@preact/signals-core": "^1.6.0" | ||
"@preact/signals-core": "^1.7.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "peerDependencies": { |
@@ -348,4 +348,6 @@ import { options, Component, isValidElement } from "preact"; | ||
export function useSignal<T>(value: T) { | ||
return useMemo(() => signal<T>(value), []); | ||
export function useSignal<T>(value: T): Signal<T>; | ||
export function useSignal<T = undefined>(): Signal<T | undefined>; | ||
export function useSignal<T>(value?: T) { | ||
return useMemo(() => signal<T | undefined>(value), []); | ||
} | ||
@@ -352,0 +354,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
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
117177
529
73266
Updated@preact/signals-core@^1.7.0