2023-03-07 09:30:05 +00:00
|
|
|
export function useServerOnlyComposable () {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-03-07 09:30:05 +00:00
|
|
|
throw new Error('this should not be called in the browser')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function useClientOnlyComposable () {
|
|
|
|
// need to do some code that fails in node but not in the browser
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.server) {
|
2023-03-07 09:30:05 +00:00
|
|
|
throw new Error('this should not be called on the server')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function setTitleToPink () {
|
|
|
|
document.querySelector('h1')!.style.color = 'pink'
|
|
|
|
}
|