Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/potato4d/nuxt-client-init-module

Provide client version of nuxtServerInit
https://github.com/potato4d/nuxt-client-init-module

module nuxt nuxt-module nuxtjs vue vuejs

Last synced: about 2 months ago
JSON representation

Provide client version of nuxtServerInit

Awesome Lists containing this project

README

        

# nuxtClientInit module

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![donate: Patreon](https://img.shields.io/badge/donate-patreon-orange.svg?style=flat-square)](https://www.patreon.com/potato4d)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![NPM version](https://img.shields.io/npm/v/nuxt-client-init-module.svg?style=flat)](https://npmjs.com/package/nuxt-client-init-module)
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)
[![NPM downloads](https://img.shields.io/npm/dm/nuxt-client-init-module.svg?style=flat)](https://npmjs.com/package/nuxt-client-init-module)
[![codecov](https://codecov.io/gh/potato4d/nuxt-client-init-module/branch/master/graph/badge.svg)](https://codecov.io/gh/potato4d/nuxt-client-init-module)

> Provide client version of `nuxtServerInit`.

`nuxt-client-init-module` provides Nuxt.js with the ability to inject processing at client initialization.
Just like `nuxtServerInit`, it is possible to implement the` nuxtClientInit` action, which is executed only on the client-side rendering, in the root Vuex module.


Buy Me A Coffee

## Installation

```bash
$ yarn add nuxt-client-init-module
```

## Usage

in nuxt.config.js

```js
{
...
modules: [
'nuxt-client-init-module'
]
...
}
```

in store/index.js

```js
export const actions = {
nuxtClientInit({ commit }, context) {
// code
}
}
```

**Note:** When working with other modules (e.g. axios) that are needed during `nuxtClientInit`, `nuxt-client-init-module` should appear earlier in the `modules` section of `nuxt.config.js` for correct functionality.

## Author

- [potato4d](https://twitter.com/potato4d)

## LICENSE

MIT

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):



HANATANI Takuma

💻 🐛 👀 💬

tosuke

🐛

Masaya Kazama

🐛

Nikita Umnov

💻

Mohammed Sohail

📖

Anton Sitnikov

📖

Simon Eldevig

🐛



Dmitry Belichack

💻

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!