pull/4156/head
Conduitry 6 years ago
parent b433440533
commit 218d23782c

@ -29,7 +29,7 @@ export function add_action(block: Block, target: string, action: Action) {
const fn = block.renderer.reference(action.name);
block.event_listeners.push(
x`@destroy_action(${id} = ${fn}.call(null, ${target}, ${snippet}))`
x`@action_destroyer(${id} = ${fn}.call(null, ${target}, ${snippet}))`
);
if (dependencies && dependencies.length > 0) {

@ -122,10 +122,6 @@ export function set_store_value(store, ret, value = ret) {
export const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
export function destroy_action(action_result) {
return () => {
if (action_result && is_function(action_result.destroy)) {
return action_result.destroy();
}
};
export function action_destroyer(action_result) {
return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
}

@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
destroy_action,
action_destroyer,
detach,
element,
init,
@ -20,7 +20,7 @@ function create_fragment(ctx) {
c() {
button = element("button");
button.textContent = "foo";
dispose = destroy_action(foo_action = foo.call(null, button, /*foo_function*/ ctx[1]));
dispose = action_destroyer(foo_action = foo.call(null, button, /*foo_function*/ ctx[1]));
},
m(target, anchor) {
insert(target, button, anchor);

@ -1,8 +1,8 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
action_destroyer,
attr,
destroy_action,
detach,
element,
init,
@ -21,7 +21,7 @@ function create_fragment(ctx) {
a = element("a");
a.textContent = "Test";
attr(a, "href", "#");
dispose = destroy_action(link_action = link.call(null, a));
dispose = action_destroyer(link_action = link.call(null, a));
},
m(target, anchor) {
insert(target, a, anchor);

Loading…
Cancel
Save