@@ -211,8 +211,8 @@ namespace Signal {
211
211
// A Signal which is a formula based on other Signals
212
212
class Computed < T > implements Signal< T > {
213
213
// Create a Signal which evaluates to the value returned by the callback.
214
- // Callback is called with this signal as the parameter .
215
- constructor (cb : (s : Computed < T > ) => T , options ?: SignalOptions < T > );
214
+ // Callback is called with this signal as the this value .
215
+ constructor (cb : (this : Computed < T > ) => T , options ?: SignalOptions < T > );
216
216
}
217
217
218
218
namespace subtle {
@@ -239,7 +239,7 @@ namespace Signal {
239
239
// When a (recursive) source of Watcher is written to, call this callback,
240
240
// if it hasn't already been called since the last `watch` call.
241
241
// No signals may be read or written during the notify.
242
- constructor (notify : (w : Watcher ) => void );
242
+ constructor (notify : (this : Watcher ) => void );
243
243
244
244
// Add these signals to the Watcher's set, and set the watcher to run its
245
245
// notify callback next time any signal in the set (or one of its dependencies) changes.
@@ -259,14 +259,14 @@ namespace Signal {
259
259
260
260
interface SignalOptions< T > {
261
261
// Custom comparison function between old and new value. Default: Object.is.
262
- // The signal is passed in as an optionally-used third parameter for context.
263
- equals?: (t : T , t2 : T , s : Signal < T > ) => boolean;
262
+ // The signal is passed in as the this value for context.
263
+ equals?: (this : Signal < T > , t : T , t2 : T ) => boolean;
264
264
265
265
// Callback called when isWatched becomes true, if it was previously false
266
- [Signal .subtle .watched ]?: (s : Signal < T > ) => void ;
266
+ [Signal .subtle .watched ]?: (this : Signal < T > ) => void ;
267
267
268
268
// Callback called whenever isWatched becomes false, if it was previously true
269
- [Signal .subtle .unwatched ]?: (s : Signal < T > ) => void ;
269
+ [Signal .subtle .unwatched ]?: (this : Signal < T > ) => void ;
270
270
}
271
271
` ` `
272
272
0 commit comments