Vuex Orm screenshot

Vuex Orm

Author Avatar Theme by Vuex orm
Updated: 3 Jul 2021
2342 Stars

The Vuex plugin to enable Object-Relational Mapping access to the Vuex Store.

Categories

Overview:

Vuex ORM is a plugin for Vuex that enables Object-Relational Mapping access to the Vuex Store. It allows for creating normalized data schemas within the Vuex Store with relationship capabilities like “Has One” and “Belongs To Many”, offering a fluent API for accessing, searching, and updating the Store state.

Features:

  • Normalized Data Schema: Allows for creating normalized data schema within Vuex Store.
  • Relationships: Supports relationships such as “Has One” and “Belongs To Many”.
  • Fluent API: Provides a fluent API for accessing, searching, and updating Store state.
  • Inspired by Redux: Heavily inspired by the Redux recipe of “Normalizing State Shape” and “Updating Normalized Data”.
  • Plugins: Supports plugins for extending functionality, including Vuex ORM Axios, Vuex ORM GraphQL, and more.

Installation:

To install Vuex ORM, you can add it to your project using npm:

npm install @vuex-orm/core

Once installed, you can import and initialize Vuex ORM in your Vue app:

import VuexORM from '@vuex-orm/core'
import Vuex from 'vuex'

const store = new Vuex.Store({
  plugins: [VuexORM.install()]
})

Summary:

Vuex ORM is a powerful plugin for Vuex that simplifies data management by providing Object-Relational Mapping capabilities within the Vuex Store. With support for normalized data schemas, relationships, and a fluent API, Vuex ORM offers an efficient way to interact with and manage state in Vuex. Furthermore, the availability of plugins allows for extending the functionality of Vuex ORM to suit various project requirements.