Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(reactivity): expose DeepReadonly #1606

Merged
merged 24 commits into from
Jul 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f308054
Merge pull request #1 from vuejs/master
Picknight Jun 17, 2020
7d68bf7
refactor(types): simplified UnwrapRef
Jun 17, 2020
c2c73cf
Merge pull request #2 from vuejs/master
Picknight Jun 25, 2020
a455677
refactor(types): simplified UnwrapRefSimple
Jun 25, 2020
e3edce7
types(reactivity): add Iterable & Iterator
Jun 25, 2020
c3f8df8
Merge pull request #3 from vuejs/master
Picknight Jun 27, 2020
a0fc926
Merge pull request #4 from vuejs/master
Picknight Jun 27, 2020
0915aea
test(reactivity): unwrap ref types
Jun 27, 2020
7c4bd0b
refactor(computed): deprecated computedRunners
Jun 27, 2020
82ed85e
revert: refactor(computed): deprecated computedRunners
Jun 27, 2020
9c7c7df
Merge pull request #5 from vuejs/master
Picknight Jun 30, 2020
7cdcb96
Merge pull request #6 from vuejs/master
Picknight Jul 1, 2020
716fa37
Merge pull request #7 from vuejs/master
Picknight Jul 2, 2020
b39e2e6
Merge pull request #8 from vuejs/master
Picknight Jul 3, 2020
0d8ad49
Merge pull request #9 from vuejs/master
Picknight Jul 4, 2020
3d6c983
Merge pull request #10 from vuejs/master
Picknight Jul 7, 2020
cc7d3a5
Merge pull request #11 from vuejs/master
Picknight Jul 8, 2020
a28c860
Merge pull request #12 from vuejs/master
Picknight Jul 9, 2020
a1f4aad
Merge pull request #13 from vuejs/master
Picknight Jul 10, 2020
7b094d4
Merge pull request #14 from vuejs/master
Picknight Jul 11, 2020
2e0bfd1
Merge pull request #15 from vuejs/master
Picknight Jul 13, 2020
b4ac43a
Merge pull request #16 from vuejs/master
Picknight Jul 16, 2020
ea4c9ab
feat(reactivity): expose DeepReadonly
Jul 17, 2020
1f40343
Update index.ts
yyx990803 Jul 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(types): simplified UnwrapRef
  • Loading branch information
pickchen committed Jun 17, 2020
commit 7d68bf7b3861839421b2c0f8597b4a2e1b02fd0a
5 changes: 2 additions & 3 deletions packages/reactivity/src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { track, trigger } from './effect'
import { TrackOpTypes, TriggerOpTypes } from './operations'
import { isObject, hasChanged } from '@vue/shared'
import { reactive, isProxy, toRaw } from './reactive'
import { ComputedRef } from './computed'
import { CollectionTypes } from './collectionHandlers'

declare const RefSymbol: unique symbol
Expand Down Expand Up @@ -157,9 +156,9 @@ type BaseTypes = string | number | boolean
*/
export interface RefUnwrapBailTypes {}

export type UnwrapRef<T> = T extends ComputedRef<infer V>
export type UnwrapRef<T> = T extends Ref<infer V>
? UnwrapRefSimple<V>
: T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>
: UnwrapRefSimple<T>

type UnwrapRefSimple<T> = T extends
| Function
Expand Down