Skip to content

Commit 4f8afa4

Browse files
committed
Least aggressive glint hack
1 parent 9c86ece commit 4f8afa4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test-app/app/helpers/clock.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export function Clock() {
1212
// return time;
1313

1414
// The above is a shorthand for this
15-
// (but with a cast to string to appease Glint's restrictive ContentValue type)
16-
// (Date is a renderable value, but Glint doesn't think so)
17-
return () => time.current.toString();
15+
return () => time.current as Date & { toHTML(): string };
16+
// this cast is a Glint Hack
17+
// because Glint things Date can't be rendered...
1818
});
1919
}
2020

test-app/types/glint-registry.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type TimeFormat from 'test-app/helpers/time-format';
77

88
declare module '@glint/environment-ember-loose/registry' {
99
export default interface Registry {
10-
'clock': typeof Clock & { (): typeof Clock };
10+
'clock': typeof Clock;
1111
'time-format': typeof TimeFormat;
1212
// Examples
1313
// state: HelperLike<{ Args: {}, Return: State }>;

0 commit comments

Comments
 (0)