Skip to content

Commit 9f61694

Browse files
committed
This might be blocked on accessor decorators
1 parent 25656df commit 9f61694

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ember-resources/src/type-tests/use.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { expectTypeOf } from 'expect-type';
22

3-
import { cell, type Reactive, resource, resourceFactory, use } from '../index.ts';
3+
import { cell, resource, resourceFactory, use } from '../index.ts';
4+
5+
import type { Reactive } from '../index.ts';
46

57
const StuckClock = resource(() => 2);
68

@@ -36,6 +38,7 @@ class DemoA {
3638
let demoA = new DemoA();
3739

3840
expectTypeOf<typeof demoA.stuck>().toMatchTypeOf<number>();
41+
expectTypeOf(demoA.clock).toMatchTypeOf<Reactive<number>>();
3942
expectTypeOf<typeof demoA.clock>().toMatchTypeOf<Reactive<number>>();
4043
expectTypeOf<typeof demoA.paramClock>().toMatchTypeOf<string>();
4144
expectTypeOf<typeof demoA.paramClock2>().toMatchTypeOf<string>();

ember-resources/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export type ResourceFunction<Value = unknown> = (hooks: ResourceAPI) => Value |
143143
*/
144144
export type ResourceFn<Value = unknown> = (hooks: ResourceAPI) => Value;
145145

146-
export type Resource<Value = unknown> = Value & Reactive<Value>;
146+
export type Resource<Value = unknown> = Value | Reactive<Value>;
147147

148148
export type Destructor = () => void;
149149
export type Cache = object;

0 commit comments

Comments
 (0)