@@ -68,14 +68,14 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
6868
6969 public override get debugName ( ) : string {
7070 if ( ! this . _debugName ) {
71- return getFunctionName ( this . computeFn ) || '(anonymous)' ;
71+ return getFunctionName ( this . _computeFn ) || '(anonymous)' ;
7272 }
7373 return typeof this . _debugName === 'function' ? this . _debugName ( ) : this . _debugName ;
7474 }
7575
7676 constructor (
7777 private readonly _debugName : string | ( ( ) => string ) | undefined ,
78- private readonly computeFn : ( reader : IReader , changeSummary : TChangeSummary ) => T ,
78+ public readonly _computeFn : ( reader : IReader , changeSummary : TChangeSummary ) => T ,
7979 private readonly createChangeSummary : ( ( ) => TChangeSummary ) | undefined ,
8080 private readonly _handleChange : ( ( context : IChangeContext , summary : TChangeSummary ) => boolean ) | undefined ,
8181 private readonly _handleLastObserverRemoved : ( ( ) => void ) | undefined = undefined
@@ -104,7 +104,7 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
104104 if ( this . observers . size === 0 ) {
105105 // Without observers, we don't know when to clean up stuff.
106106 // Thus, we don't cache anything to prevent memory leaks.
107- const result = this . computeFn ( this , this . createChangeSummary ?.( ) ! ) ;
107+ const result = this . _computeFn ( this , this . createChangeSummary ?.( ) ! ) ;
108108 // Clear new dependencies
109109 this . onLastObserverRemoved ( ) ;
110110 return result ;
@@ -153,7 +153,7 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
153153 this . changeSummary = this . createChangeSummary ?.( ) ;
154154 try {
155155 /** might call {@link handleChange} indirectly, which could invalidate us */
156- this . value = this . computeFn ( this , changeSummary ) ;
156+ this . value = this . _computeFn ( this , changeSummary ) ;
157157 } finally {
158158 // We don't want our observed observables to think that they are (not even temporarily) not being observed.
159159 // Thus, we only unsubscribe from observables that are definitely not read anymore.
0 commit comments