@dxos/react-hooks 0.8.4-main.72ec0f3 → 0.8.4-main.7ace549

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-hooks",
3
- "version": "0.8.4-main.72ec0f3",
3
+ "version": "0.8.4-main.7ace549",
4
4
  "description": "React hooks supporting DXOS React primitives.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -30,8 +30,8 @@
30
30
  "alea": "^1.0.1",
31
31
  "lodash.defaultsdeep": "^4.6.1",
32
32
  "mini-virtual-list": "^0.3.2",
33
- "@dxos/async": "0.8.4-main.72ec0f3",
34
- "@dxos/log": "0.8.4-main.72ec0f3"
33
+ "@dxos/async": "0.8.4-main.7ace549",
34
+ "@dxos/log": "0.8.4-main.7ace549"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/lodash.defaultsdeep": "^4.6.6",
@@ -2,8 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { useCallback } from '@preact-signals/safe-react/react';
6
- import { type Dispatch, type RefObject, type SetStateAction, useEffect, useRef, useState } from 'react';
5
+ import { type Dispatch, type RefObject, type SetStateAction, useCallback, useEffect, useRef, useState } from 'react';
7
6
 
8
7
  /**
9
8
  * Like `useState` but with an additional dynamic value.
@@ -15,7 +15,7 @@ describe('useMulticastObservable', () => {
15
15
  const observable = MulticastObservable.from(event, 0);
16
16
  const { result } = renderHook(() => useMulticastObservable(observable));
17
17
  expect(result.current).toEqual(0);
18
- act(() => event.emit(1));
18
+ await act(async () => event.emit(1));
19
19
  await expect.poll(() => result.current).toEqual(1);
20
20
  });
21
21
  });
package/src/useSignals.ts CHANGED
@@ -3,8 +3,7 @@
3
3
  //
4
4
 
5
5
  import { computed, effect } from '@preact-signals/safe-react';
6
- import { useRef } from '@preact-signals/safe-react/react';
7
- import { type DependencyList, useEffect, useMemo } from 'react';
6
+ import { type DependencyList, useEffect, useMemo, useRef } from 'react';
8
7
 
9
8
  /**
10
9
  * Like `useEffect` but also tracks signals inside of the callback.