move some code

blockless
Rich Harris 2 years ago
parent 393c2d5090
commit 752c42a99c

@ -18,20 +18,7 @@ import {
ROOT_EFFECT,
DESTROYED
} from '../constants.js';
/**
* @param {import('#client').Reaction} target_signal
* @param {import('#client').Reaction} ref_signal
* @returns {void}
*/
export function push_reference(target_signal, ref_signal) {
const references = target_signal.r;
if (references === null) {
target_signal.r = [ref_signal];
} else {
references.push(ref_signal);
}
}
import { push_reference } from './utils.js';
/**
* @param {import('./types.js').EffectType} type

@ -1,7 +1,7 @@
import { DEV } from 'esm-env';
import { CLEAN, DERIVED, UNINITIALIZED, UNOWNED } from '../constants.js';
import { current_consumer, current_effect } from '../runtime.js';
import { push_reference } from './computations.js';
import { push_reference } from './utils.js';
import { default_equals, safe_equal } from './equality.js';
/**

@ -0,0 +1,13 @@
/**
* @param {import('#client').Reaction} target_signal
* @param {import('#client').Reaction} ref_signal
* @returns {void}
*/
export function push_reference(target_signal, ref_signal) {
const references = target_signal.r;
if (references === null) {
target_signal.r = [ref_signal];
} else {
references.push(ref_signal);
}
}
Loading…
Cancel
Save