Skip to content

Commit 31be2f3

Browse files
committed
refactor: improve function name checks in type guards
1 parent f1391ce commit 31be2f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ export function endBatch() {
7474
}
7575

7676
export function isSignal(fn: () => void): boolean {
77-
return fn.name === 'bound signalOper';
77+
return fn.name === 'bound ' + signalOper.name;
7878
}
7979

8080
export function isComputed(fn: () => void): boolean {
81-
return fn.name === 'bound computedOper';
81+
return fn.name === 'bound ' + computedOper.name;
8282
}
8383

8484
export function isEffect(fn: () => void): boolean {
85-
return fn.name === 'bound effectOper';
85+
return fn.name === 'bound ' + effectOper.name;
8686
}
8787

8888
export function isEffectScope(fn: () => void): boolean {
89-
return fn.name === 'bound effectScopeOper';
89+
return fn.name === 'bound ' + effectScopeOper.name;
9090
}
9191

9292
export function signal<T>(): {

0 commit comments

Comments
 (0)