Skip to content

Commit 168613d

Browse files
authored
Merge branch 'main' into demo-fix-entry-names
2 parents 65da8f1 + 602f9b8 commit 168613d

14 files changed

+66
-42
lines changed

.changeset/angry-monkeys-appear.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/large-bags-smile.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/mighty-pianos-end.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/neat-dingos-shake.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/selfish-cameras-play.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/two-mails-sip.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ npm install @preact/signals-core
1717
npm install @preact/signals
1818
# If you're using React
1919
npm install @preact/signals-react
20+
# If you're using Svelte
21+
npm install @preact/signals-core
2022
```
2123

2224
- [Guide / API](#guide--api)

packages/core/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# @preact/signals-core
22

3+
## 1.1.0
4+
5+
### Minor Changes
6+
7+
- bc0080c: Add `.subscribe()`-method to signals to add support for natively using signals with Svelte
8+
9+
### Patch Changes
10+
11+
- 336bb34: Don't mangle `Signal` class name
12+
- 7228418: Fix incorrectly named variables and address typos in code comments.
13+
- 32abe07: Fix internal API functions being able to unmark non-invalidated signals
14+
- 4782b41: Fix conditionally signals (lazy branches) not being re-computed upon activation
15+
- bf6af3b: - Fix a memory leak when computed signals and effects are removed
16+
317
## 1.0.1
418

519
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@preact/signals-core",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"license": "MIT",
55
"description": "",
66
"keywords": [],

packages/core/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ export class Signal<T = any> {
123123
};
124124
}
125125

126+
subscribe(fn: (value: T) => () => void) {
127+
return effect(() => fn(this.value));
128+
}
129+
126130
/**
127131
* A custom update routine to run when this Signal's value changes.
128132
* @internal

0 commit comments

Comments
 (0)