import { storiesOf } from '@storybook/vue' import { defineComponent, ref } from '@vue/composition-api' import { useTimeoutFun } from '../index' import md from '../docs/timeoutFun.md' const Count = defineComponent({ template: `
EXAMPLE
count: {{count}}
finished: {{finished}}
`, setup() { const count = ref(0) const { fun, finished } = useTimeoutFun(function () { count.value += 1 }, 1000) return { count, fun, finished } } }) storiesOf('Function decorator|useTimeoutFun', module) .add('timeoutFun', () => Count, { readme: { sidebar: md } })