Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: regression if ssrRef is used outside setup (in dev)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jun 4, 2020
1 parent 60aaba0 commit f2beecd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const useAsync = <T>(
!_ref.value ||
(process.env.NODE_ENV === 'development' &&
process.client &&
window[globalNuxt].context.isHMR)
window[globalNuxt]?.context.isHMR)
) {
const p = cb()

Expand Down
4 changes: 2 additions & 2 deletions src/ssr-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ssrRef = <T>(value: T | (() => T), key?: string): Ref<T> => {
if (process.client) {
if (
process.env.NODE_ENV === 'development' &&
window[globalNuxt].context.isHMR
window[globalNuxt]?.context.isHMR
) {
return ref(getValue(value))
}
Expand Down Expand Up @@ -128,7 +128,7 @@ export const shallowSsrRef = <T>(
if (process.client) {
if (
process.env.NODE_ENV === 'development' &&
window[globalNuxt].context.isHMR
window[globalNuxt]?.context.isHMR
) {
return shallowRef(getValue(value))
}
Expand Down

0 comments on commit f2beecd

Please sign in to comment.