@@ -3,13 +3,13 @@ import * as React from 'react'
33import { renderHook , act } from '@testing-library/react-hooks'
44import { render } from '@testing-library/react'
55import { act as RAct } from 'react-dom/test-utils'
6- import { createStore , Model , useAtom , Provider } from '../../src'
6+ import { createStore , Model , useModel , Provider } from '../../src'
77
88describe ( 'lane model' , ( ) => {
99 test ( 'single model' , ( ) => {
1010 const wrapper = Provider
1111 const { useStore } = createStore ( ( ) => {
12- const [ count , setCount ] = useAtom ( 1 )
12+ const [ count , setCount ] = useModel ( 1 )
1313 return { count, setCount }
1414 } )
1515 let renderTimes = 0
@@ -41,7 +41,7 @@ describe('lane model', () => {
4141 const wrapper = Provider
4242 const { useStore } = Model ( { } )
4343 createStore ( 'Shared' , ( ) => {
44- const [ count , setCount ] = useAtom ( 1 )
44+ const [ count , setCount ] = useModel ( 1 )
4545 return { count, setCount }
4646 } )
4747
@@ -75,7 +75,7 @@ describe('lane model', () => {
7575 const wrapper = Provider
7676 let subscribeTimes = 0
7777 const { subscribe, unsubscribe, getState } = createStore ( ( ) => {
78- const [ count , setCount ] = useAtom ( 1 )
78+ const [ count , setCount ] = useModel ( 1 )
7979 return { count, setCount }
8080 } )
8181
@@ -123,10 +123,10 @@ describe('lane model', () => {
123123 } )
124124 } )
125125
126- test ( 'pass function to useAtom ' , ( ) => {
126+ test ( 'pass function to useModel ' , ( ) => {
127127 const wrapper = Provider
128128 const { useStore } = createStore ( ( ) => {
129- const [ count , setCount ] = useAtom ( ( ) => 1 )
129+ const [ count , setCount ] = useModel ( ( ) => 1 )
130130 return { count, setCount }
131131 } )
132132 let renderTimes = 0
@@ -157,7 +157,7 @@ describe('lane model', () => {
157157 test ( 'false value can be accepted' , ( ) => {
158158 const wrapper = Provider
159159 const { useStore } = createStore ( ( ) => {
160- const [ count , setCount ] = useAtom ( true )
160+ const [ count , setCount ] = useModel ( true )
161161 return { count, setCount }
162162 } )
163163
@@ -197,7 +197,7 @@ describe('lane model', () => {
197197 test ( 'array value is protected' , ( ) => {
198198 const wrapper = Provider
199199 const { useStore } = createStore ( ( ) => {
200- const [ list , setList ] = useAtom ( [ ] as number [ ] )
200+ const [ list , setList ] = useModel ( [ ] as number [ ] )
201201 return { list, setList }
202202 } )
203203
@@ -241,7 +241,7 @@ describe('lane model', () => {
241241 test ( 'object value is merged' , ( ) => {
242242 const wrapper = Provider
243243 const { useStore } = createStore ( ( ) => {
244- const [ obj , setObj ] = useAtom ( { name : 'Bob' , age : 17 } )
244+ const [ obj , setObj ] = useModel ( { name : 'Bob' , age : 17 } )
245245 return { obj, setObj }
246246 } )
247247
@@ -294,8 +294,8 @@ describe('lane model', () => {
294294 test ( 'multiple models' , ( ) => {
295295 const wrapper = Provider
296296 const { useStore } = createStore ( ( ) => {
297- const [ count , setCount ] = useAtom ( 1 )
298- const [ name , setName ] = useAtom ( 'Jane' )
297+ const [ count , setCount ] = useModel ( 1 )
298+ const [ name , setName ] = useModel ( 'Jane' )
299299 return { count, name, setName, setCount }
300300 } )
301301 let renderTimes = 0
@@ -336,13 +336,13 @@ describe('lane model', () => {
336336 test ( 'multiple stores' , ( ) => {
337337 const wrapper = Provider
338338 const { useStore } = createStore ( ( ) => {
339- const [ count , setCount ] = useAtom ( 1 )
339+ const [ count , setCount ] = useModel ( 1 )
340340
341341 return { count, setCount }
342342 } )
343343
344344 const { useStore : useOtherStore } = createStore ( ( ) => {
345- const [ name , setName ] = useAtom ( 'Jane' )
345+ const [ name , setName ] = useModel ( 'Jane' )
346346 return { name, setName }
347347 } )
348348 let renderTimes = 0
@@ -385,7 +385,7 @@ describe('lane model', () => {
385385 test ( 'share single model between components' , ( ) => {
386386 const wrapper = Provider
387387 const { useStore } = createStore ( ( ) => {
388- const [ count , setCount ] = useAtom ( 1 )
388+ const [ count , setCount ] = useModel ( 1 )
389389 return { count, setCount }
390390 } )
391391 let renderTimes = 0
@@ -429,16 +429,16 @@ describe('lane model', () => {
429429 }
430430
431431 const { useStore } = createStore ( ( ) => {
432- const [ count , setCount ] = useAtom ( 1 )
433- const [ name , setName ] = useAtom ( 'Jane' )
432+ const [ count , setCount ] = useModel ( 1 )
433+ const [ name , setName ] = useModel ( 'Jane' )
434434 return { count, setCount, name, setName }
435435 } )
436436 const { useStore : useOtherStore } = createStore ( ( ) => {
437- const [ data , setData ] = useAtom ( { status : 'UNKNOWN' } )
437+ const [ data , setData ] = useModel ( { status : 'UNKNOWN' } )
438438 return { data, setData }
439439 } )
440440 const { useStore : useOnce } = createStore ( ( ) => {
441- const [ status , set ] = useAtom ( false )
441+ const [ status , set ] = useModel ( false )
442442 return { status, set }
443443 } )
444444 let renderTimes = 0
0 commit comments