Skip to content

Commit

Permalink
feat: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Jul 26, 2021
1 parent 27d70b8 commit ac372c5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "veact",
"version": "0.1.0",
"version": "0.1.1",
"description": "Mutable state enhancer library for @react by @vue/reactivity",
"keywords": [
"React mutable state lib",
Expand Down
4 changes: 2 additions & 2 deletions src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { useState as useReactState } from 'react'
import { useWatch } from './watch'
import { useForceUpdate } from './utils'
import type { ToRef } from './reactivity'
import {
ref as vRef,
shallowRef as vShallowRef,
Expand All @@ -14,14 +15,13 @@ import {
computed as vComputed,
ComputedGetter,
Ref,
ToRef,
UnwrapRef,
UnwrapNestedRefs,
DebuggerOptions,
ComputedRef,
WritableComputedOptions,
WritableComputedRef,
} from './reactivity'
} from '@vue/reactivity'

/** ref hook */
export function useRef<T extends object>(value: T): ToRef<T>
Expand Down
2 changes: 1 addition & 1 deletion src/watch/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Surmon <https://github.com/surmon-china>
*/

import { isRef } from '../reactivity'
import { isRef } from '@vue/reactivity'
import { isArray, isObject, isSet, isMap, isPlainObject } from '../utils'

// fork form: https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/errorHandling.ts
Expand Down
9 changes: 8 additions & 1 deletion src/watch/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
// DOC: https://v3.vuejs.org/guide/reactivity-computed-watchers.html#watch
// fork form: https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/apiWatch.ts
import { useState as useReactState } from 'react'
import {
isRef,
isReactive,
Ref,
EffectScheduler,
ReactiveEffect,
} from '@vue/reactivity'
import { onBeforeUnmount } from '../lifecycle'
import type { ComputedRef } from '../reactivity'
import { isRef, isReactive, Ref, EffectScheduler, ReactiveEffect } from '../reactivity'

import { logger, callWithErrorHandling, callWithAsyncErrorHandling } from '../logger'
import { hasChanged, isArray, isFunction } from '../utils'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/watch/watchEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// DOC: https://v3.vuejs.org/guide/reactivity-computed-watchers.html#watcheffect
// fork form: https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/apiWatch.ts#L73
import { useState as useReactState } from 'react'
import { DebuggerOptions, ReactiveEffect, EffectScheduler } from '@vue/reactivity'
import { onBeforeUnmount } from '../lifecycle'
import { callWithErrorHandling, callWithAsyncErrorHandling } from '../logger'
import { DebuggerOptions, ReactiveEffect, EffectScheduler } from '../reactivity'
import { WATCH_CLEANUP_ERROR, WATCH_CALLBACK_ERROR } from './patch'

export type WatchEffectOptions = DebuggerOptions
Expand Down

0 comments on commit ac372c5

Please sign in to comment.