Skip to content

Commit

Permalink
chore: ついで
Browse files Browse the repository at this point in the history
  • Loading branch information
mewton committed Sep 28, 2023
1 parent d0a7e7b commit 0f49e04
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions packages/insider-vue/src/communicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0f49e04

Please sign in to comment.