mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-21 17:32:41 +00:00
refactor: use standard prettier formatting
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
import type {Action} from "svelte/action"
|
||||
import {readonly, writable} from "svelte/store"
|
||||
import type { Action } from "svelte/action";
|
||||
import { readonly, writable } from "svelte/store";
|
||||
|
||||
const setCanShare = writable(false)
|
||||
export const canShare = readonly(setCanShare)
|
||||
const setCanShare = writable(false);
|
||||
export const canShare = readonly(setCanShare);
|
||||
|
||||
let shareCallback: ((event: Event) => void) | undefined
|
||||
let shareCallback: ((event: Event) => void) | undefined;
|
||||
export function triggerShare(event: Event) {
|
||||
shareCallback?.(event)
|
||||
shareCallback?.(event);
|
||||
}
|
||||
|
||||
export const share: Action<Window, (event: Event) => void> = (node, callback: (event: Event) => void) => {
|
||||
setCanShare.set(true)
|
||||
shareCallback = callback
|
||||
export const share: Action<Window, (event: Event) => void> = (
|
||||
node,
|
||||
callback: (event: Event) => void,
|
||||
) => {
|
||||
setCanShare.set(true);
|
||||
shareCallback = callback;
|
||||
|
||||
return {
|
||||
destroy() {
|
||||
setCanShare.set(false)
|
||||
shareCallback = undefined
|
||||
setCanShare.set(false);
|
||||
shareCallback = undefined;
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user