Skip to content

Commit dab5fc3

Browse files
crisbetodevversion
authored andcommitted
fix(core): expose model signal subcribe for type checking purposes (#54357)
The `@internal` in the comment above `ModelSignal.subscribe` ended up marking the method as internal even though it wasn't meant to be. PR Close #54357
1 parent 153fc61 commit dab5fc3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

goldens/public-api/core/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,10 @@ export interface ModelSignal<T> extends WritableSignal<T> {
10991099
INPUT_SIGNAL_BRAND_WRITE_TYPE]: T;
11001100
// (undocumented)
11011101
[SIGNAL]: ModelSignalNode<T>;
1102+
// @deprecated (undocumented)
1103+
subscribe(callback: (value: T) => void): {
1104+
unsubscribe: () => void;
1105+
};
11021106
}
11031107

11041108
// @public @deprecated

packages/core/src/authoring/model/model_signal.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ export interface ModelSignal<T> extends WritableSignal<T> {
4141
[ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T;
4242
[ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: T;
4343

44-
// TODO(crisbeto): mark this as @internal
45-
/**
46-
* Subscribes to changes in the model's value. Used by listener instructions at runtime.
47-
* @deprecated Do not use, will be removed.
48-
*/
44+
// TODO(crisbeto): either make this a public API or mark as internal pending discussion.
45+
/** @deprecated Do not use, will be removed. */
4946
subscribe(callback: (value: T) => void): {unsubscribe: () => void};
5047
}
5148

0 commit comments

Comments
 (0)