Skip to content

Commit 2e71da6

Browse files
committed
Merge remote-tracking branch 'origin/dev' into 4.0
2 parents 3f87501 + b1568a5 commit 2e71da6

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# [3.3.0](https://github.com/vuejs/vuex/compare/v3.2.0...v3.3.0) (2020-04-25)
2+
3+
4+
### Bug Fixes
5+
6+
* Prepend devtool handler ([#1358](https://github.com/vuejs/vuex/issues/1358)) ([a39d076](https://github.com/vuejs/vuex/commit/a39d0767e4041cdd5cf8050774106c01d39024e0)), closes [vuejs/vue-devtools#678](https://github.com/vuejs/vue-devtools/issues/678)
7+
* **types:** Add `devtools` to store options type ([#1478](https://github.com/vuejs/vuex/issues/1478)) ([38c11dc](https://github.com/vuejs/vuex/commit/38c11dcbaea7d7e661a1623cabb5aef7c6e47ba7))
8+
9+
10+
### Features
11+
12+
* Add `prepend` option for `subscribe` and `subscribeAction` ([#1358](https://github.com/vuejs/vuex/issues/1358)) ([a39d076](https://github.com/vuejs/vuex/commit/a39d0767e4041cdd5cf8050774106c01d39024e0))
13+
* **logger:** `createLogger` can optionally log actions ([#987](https://github.com/vuejs/vuex/issues/987)) ([18be128](https://github.com/vuejs/vuex/commit/18be128ad933d1fca6da05c060f7664ce0c819ae))
14+
15+
16+
117
# [3.2.0](https://github.com/vuejs/vuex/compare/v3.1.3...v3.2.0) (2020-04-19)
218

319

types/index.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export declare class Store<S> {
2020
dispatch: Dispatch;
2121
commit: Commit;
2222

23-
subscribe<P extends MutationPayload>(fn: (mutation: P, state: S) => any): () => void;
24-
subscribeAction<P extends ActionPayload>(fn: SubscribeActionOptions<P, S>): () => void;
23+
subscribe<P extends MutationPayload>(fn: (mutation: P, state: S) => any, options?: SubscribeOptions): () => void;
24+
subscribeAction<P extends ActionPayload>(fn: SubscribeActionOptions<P, S>, options?: SubscribeOptions): () => void;
2525
watch<T>(getter: (state: S, getters: any) => T, cb: (value: T, oldValue: T) => void, options?: WatchOptions): () => void;
2626

2727
registerModule<T>(path: string, module: Module<T, S>, options?: ModuleOptions): void;
@@ -74,6 +74,10 @@ export interface ActionPayload extends Payload {
7474
payload: any;
7575
}
7676

77+
export interface SubscribeOptions {
78+
prepend?: boolean
79+
}
80+
7781
export type ActionSubscriber<P, S> = (action: P, state: S) => any;
7882

7983
export interface ActionSubscribersObject<P, S> {

types/test/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ namespace StoreInstance {
3636
state.value;
3737
});
3838

39+
store.subscribe(() => {}, { prepend: true });
40+
3941
store.subscribeAction((action, state) => {
4042
action.type;
4143
action.payload;
@@ -71,6 +73,8 @@ namespace StoreInstance {
7173
}
7274
});
7375

76+
store.subscribeAction({}, { prepend: true });
77+
7478
store.replaceState({ value: 10 });
7579
}
7680

0 commit comments

Comments
 (0)