Skip to content

Commit

Permalink
[Bugfix] Potential hosted refs bug within the useObserver() composable.
Browse files Browse the repository at this point in the history
[Bugfix] Potential hosted refs bug within the useObserver() composable. Includes added rollupOptions in vite.lib.config.ts.
  • Loading branch information
michealroberts committed Dec 29, 2021
1 parent 5b1f19d commit 594aee6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/composables/useObserver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export const validateLongitude = (longitude: number): boolean => {
return (isFinite(longitude) && Math.abs(longitude) <= 180 && Math.abs(longitude) >= -180) || false
}

// Obtain the querystring params of the url, if any:
const params = useUrlSearchParams('history')

export interface Observer {
/**
*
Expand Down Expand Up @@ -72,6 +69,9 @@ export const useObserver = (options: UseObserverOptions) => {
elevation: ele = defaultObserver.elevation
} = options

// Obtain the querystring params of the url, if any:
const params = useUrlSearchParams('history')

// Reactive Geolocation API. It allows the user to provide their location
// to web applications if they so desire. For privacy reasons, the user is
// asked for permission to report location information.
Expand Down
11 changes: 11 additions & 0 deletions vite.lib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ export default defineConfig({
entry: resolve(__dirname, 'src/index.ts'),
name: 'useaestrium',
fileName: format => `useaestrium.${format}.js`
},
rollupOptions: {
external: ['vue', '@observerly/celestia'],
output: {
sourcemap: false,
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: 'Vue'
}
}
}
}
})

0 comments on commit 594aee6

Please sign in to comment.