Redux binding for Vue.

Version Version: 3.0.0 Version Updated: 07/13/2018 By: egoist License: MIT

DownloadsLast30Days: 511

npm i revue
yarn add revue


NPM version Build Status donate

Learn Redux before using Revue. That would help you get rid of JavaScript fatigue, sort of.


Obviously it works with Redux, install via NPM: npm i --save redux revue

You can also hot-link the CDN version:, Revue is exposed to window object.

The Gist

You can try it online!


import Vue from 'vue'
import Revue from 'revue'
import {createStore} from 'redux'
// create the logic how you would update the todos
import todos from './reducers/todos'
// create some redux actions
import actions from './actions'

// create a redux store
const reduxStore = createStore(todos)
// binding the store to Vue instance, actions are optional
const store = new Revue(Vue, reduxStore, actions)
// expose the store for your component to use
export default store


// create actionCreators yourself or use `redux-actions`
export function addTodo(payload) {
  return {type: 'ADD_TODO', payload}
export function toggleTodo(payload) {
  return {type: 'TOGGLE_TODO', payload}

component.js When creating a Vue component that needs to react to data from Redux's store, you must specify the bindings between the data of the component and the data in the store. The following is an example of binding the data todo in the component with store.getState().todos by using the special function this.$select('todos').

import store from './store'
import * as todoActions from './actions/todo'

export default {
  data() {
    return {
      todo: '',
      todos: this.$select('todos')
      //=> subscribe state.todos to vm.todos
      // if prop is not in top level
      // do this.$select('todos as')
  methods: {
    addTodo() {
      store.dispatch({type: 'ADD_TODO', this.todo})
      // or use the actionCreator
      // also equal to: (if you binded actions when creating the store)
      const {addTodo} = store.actions

More detailed usages

Recipes 🍳


  • npm test run unit test
  • npm run example run webpack example



Categories: UtilitiesRedux