|
|
@ -48,7 +48,12 @@ export function validate_store(store, name) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function subscribe(component, store, callback) {
|
|
|
|
export function subscribe(component, store, callback) {
|
|
|
|
component.$$.on_destroy.push(store.subscribe(callback));
|
|
|
|
let unsub = store.subscribe(callback);
|
|
|
|
|
|
|
|
// Prevent memory leaks for RxJS users.
|
|
|
|
|
|
|
|
if (unsub.unsubscribe) {
|
|
|
|
|
|
|
|
unsub = () => unsub.unsubscribe();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
component.$$.on_destroy.push(unsub);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function create_slot(definition, ctx, fn) {
|
|
|
|
export function create_slot(definition, ctx, fn) {
|
|
|
@ -74,4 +79,4 @@ export function exclude_internal_props(props) {
|
|
|
|
const result = {};
|
|
|
|
const result = {};
|
|
|
|
for (const k in props) if (k[0] !== '$') result[k] = props[k];
|
|
|
|
for (const k in props) if (k[0] !== '$') result[k] = props[k];
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|