Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

direct-vuex

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

direct-vuex - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

2

package.json
{
"name": "direct-vuex",
"version": "0.2.2",
"version": "0.2.3",
"description": "Just Vuex with typing. Compatible with the Vue 3 composition API.",

@@ -5,0 +5,0 @@ "author": "Paleo",

@@ -15,8 +15,6 @@ # direct-vuex

The store is implemented in the same way as usual (ie. without typing).
The store is implemented in the same way as usual (ie. without typing). However, it is necessary to append `as const` at the end of store and module implementation objects. It will help direct-vuex to better infer types.
A minor detail anyway: It is necessary to append `as const` at the end of store and module implementation objects. It will help direct-vuex to better infer types.
Create the store:
Then, create the store:
import Vue from "vue"

@@ -23,0 +21,0 @@ import Vuex from "vuex"

import { Store } from "vuex"
import { ActionsImpl, GettersImpl, ModulesImpl, MutationsImpl, StoreOptions, StoreOrModuleOptions } from "./index"
export interface ToDirectStore<O extends StoreOptions> {
export type ToDirectStore<O extends StoreOptions> = ToFlatStore<{
original: Store<DirectState<O>>,

@@ -10,3 +10,3 @@ state: DirectState<O>

dispatch: DirectActions<O>
}
}>

@@ -91,2 +91,8 @@ // State

type UnionToIntersection<U> =
(U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never
(U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never
type ToFlatStore<T> =
T extends Store<any> | Function ? T :
T extends object ?
T extends infer O ? { [K in keyof O]: ToFlatStore<O[K]> } : never
: T
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