Skip to content

Commit 95eeb1c

Browse files
committed
improvement(useCookie): Adding tests and documentation, and also adding the @src/api file
1 parent 019918f commit 95eeb1c

File tree

64 files changed

+271
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+271
-154
lines changed

package-lock.json

Lines changed: 15 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
"@storybook/theming": "^5.3.13",
9494
"@storybook/vue": "^5.3.13",
9595
"@types/jest": "^23.3.2",
96-
"@types/js-cookie": "^2.2.4",
9796
"@types/node": "^10.11.0",
9897
"@types/throttle-debounce": "^2.1.0",
9998
"@typescript-eslint/eslint-plugin": "^2.18.0",
@@ -139,7 +138,7 @@
139138
"vue-template-compiler": "^2.6.11"
140139
},
141140
"dependencies": {
142-
"js-cookie": "^2.2.1",
141+
"cookie-universal": "^2.1.1",
143142
"throttle-debounce": "^2.1.0"
144143
}
145144
}

src/api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from '@vue/composition-api'
2+
export { default } from '@vue/composition-api'

src/components/useBeforeUnload/stories/UseBeforeUnloadDemo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<script lang="ts">
3333
import Vue from 'vue'
34-
import { ref, watch } from '@vue/composition-api'
34+
import { ref, watch } from '@src/api'
3535
import { useBeforeUnload } from '@src/vue-use-kit'
3636
3737
export default Vue.extend({

src/components/useBeforeUnload/stories/useBeforeUnload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function useBeforeUnload(
4545

4646
<script lang="ts">
4747
import Vue from 'vue'
48-
import { ref, watch } from '@vue/composition-api'
48+
import { ref, watch } from '@src/api'
4949
import { useBeforeUnload } from 'vue-use-kit'
5050
5151
export default Vue.extend({

src/components/useBeforeUnload/useBeforeUnload.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
checkOnStartEvents,
55
checkOnStopEvents
66
} from '@src/helpers/test'
7-
import { ref } from '@vue/composition-api'
7+
import { ref } from '@src/api'
88
import { useBeforeUnload } from '@src/vue-use-kit'
99

1010
afterEach(() => {

src/components/useBeforeUnload/useBeforeUnload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ref, onMounted, onUnmounted, Ref } from '@vue/composition-api'
1+
import { ref, onMounted, onUnmounted, Ref } from '@src/api'
22

33
export function useBeforeUnload(isPageDirty: Ref<boolean>, runOnMount = true) {
44
const isTracking = ref(false)

src/components/useClickAway/stories/UseClickAwayDemo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<script lang="ts">
2727
import Vue from 'vue'
28-
import { ref } from '@vue/composition-api'
28+
import { ref } from '@src/api'
2929
import { useClickAway } from '@src/vue-use-kit'
3030
3131
export default Vue.extend({

src/components/useClickAway/stories/useClickAway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function useClickAway(
3030

3131
<script lang="ts">
3232
import Vue from 'vue'
33-
import { ref } from '@vue/composition-api'
33+
import { ref } from '@src/api'
3434
import { useClickAway } from 'vue-use-kit'
3535
3636
export default Vue.extend({

src/components/useClickAway/useClickAway.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { checkOnMountAndUnmountEvents, mount } from '@src/helpers/test'
2-
import { ref } from '@vue/composition-api'
2+
import { ref } from '@src/api'
33
import { useClickAway } from '@src/vue-use-kit'
44

55
afterEach(() => {

0 commit comments

Comments
 (0)