@svelkit/delay
Version:
> a delay component for [svelte] (part of [svelkit])
3 lines (2 loc) • 1.21 kB
JavaScript
import{SvelteComponent as _,init as h,safe_not_equal as p,update_slot as b,transition_in as r,transition_out as c,empty as v,insert as w,group_outros as k,check_outros as y,detach as g,create_slot as D}from"svelte/internal";import{onDestroy as T}from"svelte";function m(s){let o;const i=s[4].default,e=D(i,s,s[3],null);return{c(){e&&e.c()},m(t,l){e&&e.m(t,l),o=!0},p(t,l){e&&(e.p&&l&8&&b(e,i,t,t[3],l,null,null))},i(t){if(o)return;r(e,t),o=!0},o(t){c(e,t),o=!1},d(t){e&&e.d(t)}}}function N(s){let o,i,e=s[0]&&m(s);return{c(){e&&e.c(),o=v()},m(t,l){e&&e.m(t,l),w(t,o,l),i=!0},p(t,[l]){t[0]?e?(e.p(t,l),l&1&&r(e,1)):(e=m(t),e.c(),r(e,1),e.m(o.parentNode,o)):e&&(k(),c(e,1,1,()=>{e=null}),y())},i(t){if(i)return;r(e),i=!0},o(t){c(e),i=!1},d(t){e&&e.d(t),t&&g(o)}}}function R(s,o,i){let{$$slots:e={},$$scope:t}=o,{show:l=!0}=o,{ms:u=200}=o,f,a;T(()=>clearTimeout(a));const d=n=>{clearTimeout(a),i(0,f=!1),n&&(a=setTimeout(()=>{i(0,f=!0)},u))};return s.$$set=n=>{"show"in n&&i(1,l=n.show),"ms"in n&&i(2,u=n.ms),"$$scope"in n&&i(3,t=n.$$scope)},s.$$.update=()=>{s.$$.dirty&2&&d(l)},[f,l,u,t,e]}class S extends _{constructor(s){super();h(this,s,R,N,p,{show:1,ms:2})}}export default S;
//# sourceMappingURL=delay.js.map