From 0f49e04c8f87e557d4d51273d5284c3712136e50 Mon Sep 17 00:00:00 2001 From: mewton Date: Fri, 29 Sep 2023 03:12:40 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=E3=81=A4=E3=81=84=E3=81=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/insider-vue/src/communicator.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/insider-vue/src/communicator.ts b/packages/insider-vue/src/communicator.ts index 131dc4c8..252301b1 100644 --- a/packages/insider-vue/src/communicator.ts +++ b/packages/insider-vue/src/communicator.ts @@ -103,30 +103,26 @@ function createClientCommunicator(config: InsiderVueConfig): InsideCommunicator } function createServerCommunicator(): InsideCommunicator { + // eslint-disable-next-line @typescript-eslint/no-empty-function + const noop = (): undefined => {} + const errorMessage = 'communicator is not available in SSR' + return { get communicator(): Communicator { - throw new Error('communicator is not available in SSR') + throw new Error(errorMessage) }, get hooks(): Communicator['hooks'] { - throw new Error('communicator is not available in SSR') + throw new Error(errorMessage) }, get layout() { - return computed(() => undefined) - }, - - navigate() { - // noop + return computed(noop) }, - href() { - // noop - }, - - sendData() { - // noop - }, + navigate: noop, + href: noop, + sendData: noop } satisfies InsideCommunicator }