File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ export {
101101 text ,
102102 props_id
103103} from './dom/template.js' ;
104- export { derived , derived_safe_equal } from './reactivity/deriveds.js' ;
104+ export { user_derived as derived , derived_safe_equal } from './reactivity/deriveds.js' ;
105105export {
106106 effect_tracking ,
107107 effect_root ,
Original file line number Diff line number Diff line change @@ -55,15 +55,26 @@ export function derived(fn) {
5555 parent : parent_derived ?? active_effect
5656 } ;
5757
58- push_reaction_value ( signal ) ;
59-
6058 if ( DEV && tracing_mode_flag ) {
6159 signal . created = get_stack ( 'CreatedAt' ) ;
6260 }
6361
6462 return signal ;
6563}
6664
65+ /**
66+ * @template V
67+ * @param {() => V } fn
68+ * @returns {Derived<V> }
69+ */
70+ export function user_derived ( fn ) {
71+ const d = derived ( fn ) ;
72+
73+ push_reaction_value ( d ) ;
74+
75+ return d ;
76+ }
77+
6778/**
6879 * @template V
6980 * @param {() => V } fn
You can’t perform that action at this time.
0 commit comments