Skip to content

Commit

Permalink
fix: change name vueOptionsStateHook to vueOptionsHook
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Sep 29, 2023
1 parent ed7ff45 commit dc1f0cc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ First use `vueOptionStatesHook` to create an alova instance.
```javascript
import { createAlova, Method } from 'alova';
import GlobalFetch from 'alova/GlobalFetch';
import { VueOptionsStateHook } from '@alova/vue-options';
import { VueOptionsHook } from '@alova/vue-options';

// api.js
const alovaInst = createAlova({
baseURL: 'http://example.com',
statesHook: VueOptionsStateHook,
statesHook: VueOptionsHook,
requestAdapter: GlobalFetch(),
responded: response => response.json()
});
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ yarn add alova @alova/vue-options
```javascript
import { createAlova, Method } from 'alova';
import GlobalFetch from 'alova/GlobalFetch';
import { VueOptionsStateHook } from '@alova/vue-options';
import { VueOptionsHook } from '@alova/vue-options';

// api.js
const alovaInst = createAlova({
baseURL: 'http://example.com',
statesHook: VueOptionsStateHook,
statesHook: VueOptionsHook,
requestAdapter: GlobalFetch(),
responded: response => response.json()
});
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as mapAlovaHook } from './mapAlovaHook';
export { default as VueOptionsStateHook } from './stateHook';
export { default as VueOptionsHook } from './stateHook';
4 changes: 2 additions & 2 deletions test/mockData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createAlovaMockAdapter, defineMock } from '@alova/mock';
import { createAlova } from 'alova';
import { VueOptionsStateHook } from '../src';
import { VueOptionsHook } from '../src';

const mockData = defineMock({
'/unit-test': ({ query }) => ({
Expand All @@ -16,7 +16,7 @@ const mockData = defineMock({
// create a alova instance
export const alovaInst = createAlova({
baseURL: 'http://example.com',
statesHook: VueOptionsStateHook,
statesHook: VueOptionsHook,
localCache: null,
requestAdapter: createAlovaMockAdapter([mockData], {
delay: 50,
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ interface VueHookMapperMixin<GR extends UseHookCallers> {
declare function mapAlovaHook<GR extends UseHookCallers>(mapGetter: UseHookMapGetter<GR>): VueHookMapperMixin<GR>[];

/** vue options statesHook */
declare const VueOptionsStateHook: StatesHook<unknown, unknown>;
declare const VueOptionsHook: StatesHook<unknown, unknown>;

0 comments on commit dc1f0cc

Please sign in to comment.