@@ -92,7 +92,7 @@ function SignalValue(this: AugmentedComponent, { data }: { data: Signal }) {
9292 const currentSignal = useSignal ( data ) ;
9393 currentSignal . value = data ;
9494
95- const [ isText , s ] = useStoreOnce ( ( ) => {
95+ const [ isText , s ] = useStoreValueOnce ( ( ) => {
9696 let self = this ;
9797 // mark the parent component as having computeds so it gets optimized
9898 let v = this . __v ;
@@ -404,7 +404,7 @@ Component.prototype.shouldComponentUpdate = function (
404404export function useSignal < T > ( value : T , options ?: SignalOptions < T > ) : Signal < T > ;
405405export function useSignal < T = undefined > ( ) : Signal < T | undefined > ;
406406export function useSignal < T > ( value ?: T , options ?: SignalOptions < T > ) {
407- return useStoreOnce ( ( ) =>
407+ return useStoreValueOnce ( ( ) =>
408408 signal < T | undefined > ( value , options as SignalOptions )
409409 ) ;
410410}
@@ -413,7 +413,9 @@ export function useComputed<T>(compute: () => T, options?: SignalOptions<T>) {
413413 const $compute = useRef ( compute ) ;
414414 $compute . current = compute ;
415415 ( currentComponent as AugmentedComponent ) . _updateFlags |= HAS_COMPUTEDS ;
416- return useStoreOnce ( ( ) => computed < T > ( ( ) => $compute . current ( ) , options ) ) ;
416+ return useStoreValueOnce ( ( ) =>
417+ computed < T > ( ( ) => $compute . current ( ) , options )
418+ ) ;
417419}
418420
419421function safeRaf ( callback : ( ) => void ) {
@@ -523,7 +525,7 @@ function getState(index: number): HookState {
523525 return hooks . _list [ index ] ;
524526}
525527
526- function useStoreOnce < T > ( factory : ( ) => T ) : T {
528+ export function useStoreValueOnce < T > ( factory : ( ) => T ) : T {
527529 const state = getState ( currentHookIndex ++ ) ;
528530 if ( ! state . _stored ) {
529531 state . _stored = true ;
@@ -532,8 +534,8 @@ function useStoreOnce<T>(factory: () => T): T {
532534 return state . _value ;
533535}
534536
535- function useRef < T > ( initialValue : T ) : { current : T } {
536- return useStoreOnce ( ( ) => ( { current : initialValue } ) ) ;
537+ export function useRef < T > ( initialValue : T ) : { current : T } {
538+ return useStoreValueOnce ( ( ) => ( { current : initialValue } ) ) ;
537539}
538540
539541function useOnce ( callback : ( ) => void | ( ( ) => void ) ) : void {
0 commit comments