Skip to content

Commit

Permalink
Replace self with this in watcher example (#144)
Browse files Browse the repository at this point in the history
Notify does not actually take in `self` but of course `this` is a available here.
  • Loading branch information
yeomanse authored Apr 6, 2024
1 parent b44a79d commit 3bc53fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,13 @@ The `Watcher` interface defined above gives the basis for implementing typical J
// NOTE: This scheduling logic is too basic to be useful. Do not copy/paste.
let pending = false;

let w = new Signal.subtle.Watcher(self => {
let w = new Signal.subtle.Watcher(() => {
if (!pending) {
pending = true;
queueMicrotask(() => {
pending = false;
for (let s of self.getPending()) s.get();
self.watch();
for (let s of this.getPending()) s.get();
this.watch();
});
}
});
Expand Down

0 comments on commit 3bc53fb

Please sign in to comment.