feat(reactivity): add isShallow api
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { isReactive, reactive, shallowReactive } from '../src/reactive'
|
||||
import {
|
||||
isReactive,
|
||||
isShallow,
|
||||
reactive,
|
||||
shallowReactive,
|
||||
shallowReadonly
|
||||
} from '../src/reactive'
|
||||
|
||||
import { effect } from '../src/effect'
|
||||
|
||||
@@ -24,6 +30,11 @@ describe('shallowReactive', () => {
|
||||
expect(isReactive(reactiveProxy.foo)).toBe(true)
|
||||
})
|
||||
|
||||
test('isShallow', () => {
|
||||
expect(isShallow(shallowReactive({}))).toBe(true)
|
||||
expect(isShallow(shallowReadonly({}))).toBe(true)
|
||||
})
|
||||
|
||||
describe('collections', () => {
|
||||
test('should be reactive', () => {
|
||||
const shallowSet = shallowReactive(new Set())
|
||||
|
||||
Reference in New Issue
Block a user