New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vuex-url-search-params

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuex-url-search-params

Persist and rehydrate your Vuex store via url search params (window.location.search)

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

Vuex URL Search Params

License Build Status Coverage Status

Description

Persist and rehydrate your Vuex store via url search params (window.location.search).

Installation

npm i --save vuex-url-search-params
# or
yarn add vuex-url-search-params

Testing

npm i --no-save vue@2.x vue-template-compiler@2.x vuex@3.x # Optionally
yarn test:jest # Runs Jest with coverage collection
yarn test:coverage # Sends coverage to .coveralls.io
yarn test # yarn test:jest && yarn test:coverage

Usage

Look at the quite complex example at CodeSandbox:

Edit vuex-url-search-params

Configuring

Note, this plugin is now suitable only for array-like and iterable Vuex state values!

Options

subscribeTo = [] <Array>

Mutations types for subscribing.

modifiers = {} <Object>

Object which defines how to <mutationType> payload will be transform to the query string search param and back

modifiers.<mutationType>.key <String>

Query string search param name

modifiers.<mutationType>.pushStateModifier <Function>

Function for modifying mutation payload value for using it in a query string search param with key above. Accepts <mutationType> payload as the first argument and Vuex store object as the second

modifiers.<mutationType>.popStateModifier <Function>

Function for modifying query string search param value for using it in an appropriate mutation. Accepts query string search param value as the first argument and Vuex store object as the second

modifiers.<mutationType>.emptyStateModifier <Function>

Function which result will be used as payload value for mutation when an appropriate query string search param become empty. Accepts Vuex store object as argument

qs = window.location.search <String>

Query string for initialization

store <Vuex.Store>

Vuex store object

Keywords

FAQs

Package last updated on 23 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc