Skip to content

Commit

Permalink
feat: enable setting refreshOnceOnNavigation during runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
pimlie committed Sep 17, 2019
1 parent b73b8ed commit 9d14387
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/shared/$meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import refresh from '../client/refresh'
import inject from '../server/inject'
import { showWarningNotSupported } from '../shared/log'
import { addApp } from './additional-app'
import { addNavGuards } from './nav-guards'
import { pause, resume } from './pausing'
import { getOptions } from './options'

Expand All @@ -13,6 +14,11 @@ export default function $meta (options = {}) {
*/
return {
getOptions: () => getOptions(options),
setOptions: ({ refreshOnceOnNavigation } = {}) => {
if (refreshOnceOnNavigation) {
addNavGuards(this)
}
},
refresh: () => refresh(this, options),
inject: () => process.server ? inject(this, options) : showWarningNotSupported(),
pause: () => pause(this),
Expand Down

0 comments on commit 9d14387

Please sign in to comment.