Skip to content

Commit

Permalink
chore: document parameters of onWatcherCleanup (#11768)
Browse files Browse the repository at this point in the history
  • Loading branch information
cexbrayat authored Sep 2, 2024
1 parent a3c104d commit d427bcd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/reactivity/src/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export function resetTracking(): void {
* The cleanup function is called right before the next effect run, or when the
* effect is stopped.
*
* Throws a warning iff there is no currenct active effect. The warning can be
* Throws a warning if there is no current active effect. The warning can be
* suppressed by passing `true` to the second argument.
*
* @param fn - the cleanup function to be registered
Expand Down
4 changes: 4 additions & 0 deletions packages/reactivity/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export function getCurrentWatcher(): ReactiveEffect<any> | undefined {
* associated effect re-runs.
*
* @param cleanupFn - The callback function to attach to the effect's cleanup.
* @param failSilently - if `true`, will not throw warning when called without
* an active effect.
* @param owner - The effect that this cleanup function should be attached to.
* By default, the current active effect.
*/
export function onWatcherCleanup(
cleanupFn: () => void,
Expand Down

0 comments on commit d427bcd

Please sign in to comment.