Skip to content

Commit e407bdc

Browse files
Merge pull request #1484 from glimmerjs/make-other-ref-creators-generic
Unify reference factory function signatures
2 parents 27e2deb + 488a8ef commit e407bdc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/@glimmer/reference/lib/reference.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ReferenceImpl<T = unknown> implements Reference<T> {
5656
}
5757
}
5858

59-
export function createPrimitiveRef<T = unknown>(value: T): Reference<T> {
59+
export function createPrimitiveRef<T>(value: T): Reference<T> {
6060
const ref = new ReferenceImpl<T>(UNBOUND);
6161

6262
ref.tag = CONSTANT_TAG;
@@ -74,8 +74,8 @@ export const NULL_REFERENCE = createPrimitiveRef(null);
7474
export const TRUE_REFERENCE = createPrimitiveRef(true as const);
7575
export const FALSE_REFERENCE = createPrimitiveRef(false as const);
7676

77-
export function createConstRef(value: unknown, debugLabel: false | string): Reference {
78-
const ref = new ReferenceImpl(CONSTANT);
77+
export function createConstRef<T>(value: T, debugLabel: false | string): Reference<T> {
78+
const ref = new ReferenceImpl<T>(CONSTANT);
7979

8080
ref.lastValue = value;
8181
ref.tag = CONSTANT_TAG;
@@ -87,8 +87,8 @@ export function createConstRef(value: unknown, debugLabel: false | string): Refe
8787
return ref;
8888
}
8989

90-
export function createUnboundRef(value: unknown, debugLabel: false | string): Reference {
91-
const ref = new ReferenceImpl(UNBOUND);
90+
export function createUnboundRef<T>(value: T, debugLabel: false | string): Reference<T> {
91+
const ref = new ReferenceImpl<T>(UNBOUND);
9292

9393
ref.lastValue = value;
9494
ref.tag = CONSTANT_TAG;

0 commit comments

Comments
 (0)