mirror of https://github.com/sveltejs/svelte
52 lines
947 B
52 lines
947 B
/* generated by Svelte vX.Y.Z */
|
|
import {
|
|
SvelteComponent,
|
|
add_render_callback,
|
|
init,
|
|
listen,
|
|
noop,
|
|
run_all,
|
|
safe_not_equal
|
|
} from "svelte/internal";
|
|
|
|
function create_fragment(ctx) {
|
|
let dispose;
|
|
add_render_callback(/*onlinestatuschanged*/ ctx[1]);
|
|
|
|
return {
|
|
c: noop,
|
|
m(target, anchor, remount) {
|
|
if (remount) run_all(dispose);
|
|
|
|
dispose = [
|
|
listen(window, "online", /*onlinestatuschanged*/ ctx[1]),
|
|
listen(window, "offline", /*onlinestatuschanged*/ ctx[1])
|
|
];
|
|
},
|
|
p: noop,
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
run_all(dispose);
|
|
}
|
|
};
|
|
}
|
|
|
|
function instance($$self, $$props, $$invalidate) {
|
|
let online;
|
|
|
|
function onlinestatuschanged() {
|
|
$$invalidate(0, online = navigator.onLine);
|
|
}
|
|
|
|
return [online, onlinestatuschanged];
|
|
}
|
|
|
|
class Component extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance, create_fragment, safe_not_equal, {});
|
|
}
|
|
}
|
|
|
|
export default Component; |