We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a29e4d5 commit c1c075fCopy full SHA for c1c075f
src/test/select.test.ts
@@ -4,6 +4,21 @@ import { select } from '../select'
4
5
6
describe(select, () => {
7
+ test('proxies a source.', () => {
8
+ const src = new State(0)
9
+ const selected = select(src)
10
+
11
+ const cb = jest.fn()
12
13
+ observe($ => cb($(selected)!))
14
15
+ src.set(1)
16
+ expect(cb).toHaveBeenCalledWith(1)
17
18
+ src.set(2)
19
+ expect(cb).toHaveBeenCalledWith(2)
20
+ })
21
22
test('without select, higher order sources are stopped after switch.', () => {
23
const flag = new State(false)
24
const a = new State('a')
0 commit comments