pinia-plugin-subscription 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.8]
9
+
10
+ ### Added
11
+ - Added `onError` parameter to `storeOnActionSubscription` method
12
+ - Added `onError` property to `StoreOnActionCallbackParameters` interface
13
+
14
+ ### Changed
15
+ - Changing the directory structure
16
+
8
17
  ## [0.1.7]
9
18
 
10
19
  ### Changed
package/README.md CHANGED
@@ -245,7 +245,7 @@ An object with at least an `invoke(context: PiniaPluginContext, debug?: boolean)
245
245
 
246
246
  ## The `PluginSubscriber` Abstract Class
247
247
 
248
- The project provides an abstract `PluginSubscriber` implementation (see [src/plugins/pluginSubscriber.ts](src/plugins/pluginSubscriber.ts)) to simplify creating reusable subscribers.
248
+ The project provides an abstract `PluginSubscriber` implementation (see [src/core/PluginSubscriber.ts](src/core/PluginSubscriber.ts)) to simplify creating reusable subscribers.
249
249
 
250
250
  **Typical usage:**
251
251
 
@@ -1,4 +1,4 @@
1
- import Store from "../core/Store";
1
+ import Store from "./Store";
2
2
  import type { PiniaPluginContext, Store as PiniaStore } from "pinia";
3
3
  import type { AnyObject } from "../types";
4
4
  import type { PluginExecutionOptions, PluginHydrationScheduler, PluginSubscriber as PluginSubscriberInterface, PluginSubscriptions, StoreMutationSubscription, StoreOnActionSubscription } from "../types/plugin";
@@ -1,4 +1,4 @@
1
- export { default as PluginSubscriber } from '../plugins/pluginSubscriber';
1
+ export { default as PluginSubscriber } from '../core/PluginSubscriber';
2
2
  export { default as Store } from '../core/Store';
3
3
  export { CustomConsole } from '../system/log';
4
4
  export { isEmpty } from '../utils/validation';
@@ -1,5 +1,5 @@
1
- import PluginSubscriber from '../plugins/pluginSubscriber';
2
- import PluginSubscription from '../plugins/pluginSubscription';
1
+ import PluginSubscriber from '../core/PluginSubscriber';
2
+ import PluginSubscription from '../core/PluginSubscription';
3
3
  import Store from '../core/Store';
4
4
  export { createPlugin } from "../plugins/createPlugin";
5
5
  export { createHydrationPlugin } from "../plugins/createHydrationPlugin";
@@ -193,8 +193,8 @@ class p extends g {
193
193
  }
194
194
  storeOnActionSubscription(e) {
195
195
  const { store: i, callback: t } = e();
196
- i.$onAction(({ after: s, args: n, name: d }) => {
197
- this.debugLog(`storeOnActionSubscription ${i.$id}`, { after: s, args: n, name: d, store: i }), t({ after: s, args: n, name: d });
196
+ i.$onAction(({ after: s, args: n, name: d, onError: u }) => {
197
+ this.debugLog(`storeOnActionSubscription ${i.$id}`, { after: s, args: n, name: d, store: i }), t({ after: s, args: n, name: d, onError: u });
198
198
  });
199
199
  }
200
200
  storeMutationSubscription(e) {
@@ -37,6 +37,7 @@ export interface StoreOnActionCallbackParameters {
37
37
  after: Function;
38
38
  args: any[] | object;
39
39
  name: string;
40
+ onError?: Error | unknown;
40
41
  }
41
42
  export interface PluginSubscription {
42
43
  stores?: Store[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinia-plugin-subscription",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Pinia plugin for Vue.js that helps building Pinia plugins by centralizing subscriber registration and providing a Store base class for store helpers.",
5
5
  "type": "module",
6
6
  "sideEffects": false,