Nuxt/test/fixtures/module/modules/hooks/index.js
Jonas Galvez 3f1d634fb7 Consistent parens in arrow functions (#3630)
* Minor consistency enhancements

* Arrow parenthesis consistency

* Change linting rule

* Fix typo

* Update .eslintrc.js to only require parens for blocks

* Update style according to brace-only suggestion

* Remove --fix from lint

* Tweak no-loading time (failing test)

* Tweak no-loading time (failing test) (2)

* Tweak no-loading time (failing test) (3)

* Tweak no-loading time (failing test) (4)

* Tweak no-loading time (failing test) (5)
2018-08-06 02:12:44 +02:00

28 lines
676 B
JavaScript

export default function () {
let ctr = 1
// Add hook for module
this.nuxt.hook('modules:done', (moduleContainer) => {
this.nuxt.__module_hook = moduleContainer && ctr++
})
// Add hook for renderer
this.nuxt.hook('render:done', (renderer) => {
this.nuxt.__renderer_hook = renderer && ctr++
})
// Get data before data sent to client
this.nuxt.hook('render:context', (data) => {
this.nuxt.__render_context = data
})
// Add hook for build
this.nuxt.hook('build:done', (builder) => {
this.nuxt.__builder_hook = builder && ctr++
})
this.nuxt.hook('build:done', (builder) => {
this.nuxt.__builder_plugin = builder && ctr++
})
}