Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Oct 4, 2024
1 parent 8c1d4d1 commit b4c3b10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/reactivity-core/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function syncEffect(callback: EffectCallback): CleanupHandle {
* Note that `onInvalidate` will never be invoked more than once.
*
* @deprecated This function is no longer needed and will be removed in a future release.
*
*
* @group Watching
*/
export function syncEffectOnce(callback: EffectCallback, onInvalidate: () => void): CleanupHandle {
Expand Down
9 changes: 6 additions & 3 deletions packages/reactivity-core/watchDirty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { effect as rawEffect } from "@preact/signals-core";
import { CleanupHandle, ReadonlyReactive } from "./types";

/**
* **Experimental**.
* **Experimental**.
* Notifies the given `callback` whenever the `signal` might have changed,
* without recomputing the signal's current value.
*
* This is a difficult to use, low level API that can be used to build higher level abstractions.
*
*
* Things to keep in mind when using this function:
* The `callback` should be cheap to invoke (as a signal might change often) and it **must not** throw an exception.
* It should also not make use of any reactive values.
Expand All @@ -17,7 +17,10 @@ import { CleanupHandle, ReadonlyReactive } from "./types";
*
* @group Watching
*/
export function subtleWatchDirty<T>(signal: ReadonlyReactive<T>, callback: () => void): CleanupHandle {
export function subtleWatchDirty<T>(
signal: ReadonlyReactive<T>,
callback: () => void
): CleanupHandle {
// Uses the effect's internals to track signal invalidations.
// The effect body is only called once!
// See https://github.com/preactjs/signals/issues/593#issuecomment-2349672856
Expand Down

0 comments on commit b4c3b10

Please sign in to comment.