fix: allow `$.state` and `$.derived` to be treeshaken (#15702)

pull/15705/head
Rich Harris 5 months ago committed by GitHub
parent 6a668c4daf
commit caf62ee687
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow `$.state` and `$.derived` to be treeshaken

@ -67,6 +67,7 @@ export function derived(fn) {
* @param {() => V} fn
* @returns {Derived<V>}
*/
/*#__NO_SIDE_EFFECTS__*/
export function user_derived(fn) {
const d = derived(fn);

@ -78,6 +78,7 @@ export function source(v, stack) {
* @param {V} v
* @param {Error | null} [stack]
*/
/*#__NO_SIDE_EFFECTS__*/
export function state(v, stack) {
const s = source(v, stack);

Loading…
Cancel
Save