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

@preact/signals

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@preact/signals - npm Package Compare versions

Comparing version 1.2.3 to 1.3.0

11

CHANGELOG.md
# @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 @@

1

dist/signals.d.ts
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;

4

package.json
{
"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

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