Skip to content

Commit

Permalink
fix(core): expose model signal subcribe for type checking purposes (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
crisbeto authored and devversion committed Feb 9, 2024
1 parent 9e2c140 commit 4b96f37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions goldens/public-api/core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,10 @@ export interface ModelSignal<T> extends WritableSignal<T> {
INPUT_SIGNAL_BRAND_WRITE_TYPE]: T;
// (undocumented)
[SIGNAL]: ModelSignalNode<T>;
// @deprecated (undocumented)
subscribe(callback: (value: T) => void): {
unsubscribe: () => void;
};
}

// @public @deprecated
Expand Down
7 changes: 2 additions & 5 deletions packages/core/src/authoring/model/model_signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ export interface ModelSignal<T> extends WritableSignal<T> {
[ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T;
[ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: T;

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

Expand Down

0 comments on commit 4b96f37

Please sign in to comment.