- Fix:
watchEffect
maximum recursive updates exceeded.
- Fix: Type: DeepReadonly to Readonly
- Fix: Sync query string to conditions convert type bug fix, need check the initial array value type before update conditions.
// If query string &types=1,2,3
const conditions = {
types: []
}
// the conditions.types convert value will be ['1', '2', '3']
const conditions = {
types: ['1']
}
// the conditions.types convert value will be ['1', '2', '3']
const conditions = {
types: [1]
}
// the conditions.types convert value will be [1, 2, 3]
- Fix: Cache not work on globally.
loading
: when !data.value & !error.value
will be true
.
data
: change default value null
to undefined
error
: change default value null
to undefined
isFetching
: The status of the request being processed.
error in ./node_modules/vue-condition-watcher/esm/core/utils/helper.js
Module parse failed: Unexpected token (9:66)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export const hasWindow = () => typeof window != STR_UNDEFINED;
| export const hasDocument = () => typeof document != STR_UNDEFINED;
> export const isDocumentVisibility = () => hasDocument() && window?.document?.visibilityState === 'visible';
| export const hasRequestAnimationFrame = () => hasWindow() && typeof window['requestAnimationFrame'] != STR_UNDEFINED;
| export const isNil = (val) => val === null || val === undefined;
@ ./node_modules/vue-condition-watcher/esm/core/useConditionWatcher.js 6:0-96 10:15-27 15:15-27 49:35-43 140:12-23 140:39-47 144:12-15
@ ./node_modules/vue-condition-watcher/esm/index.js
@ ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/InfiniteScrolling.vue?vue&type=script&lang=js&
@ ./src/views/InfiniteScrolling.vue?vue&type=script&lang=js&
@ ./src/views/InfiniteScrolling.vue
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.68.114:8081&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
- Change
data
type: ref
to shallowRef
mutate
now support callback function
const finalData = mutate((currentData) => {
currentData[0].name = 'runkids'
return currentData
})
resetConditions
can receiver object to update conditions
const config = {
conditions: {
a: '1',
b: '2'
}
}
// to default conditions value
resetConditions() // { a: '1', b: '2' }
// update by key value
resetConditions({
b: '3'
}) // { a: '1', b: '3' }
- Add new configs for Polling feature:
- pollingInterval: default is 0
- pollingWhenHidden: default is false
- pollingWhenOffline: default is false
- Add new configs for Revalidate on Focu feature:
- revalidateOnFocus: default is false
- Add new configs for Cache & Preload
- cacheProvider:
() => new Map()
manual
: you can manual fetching data now, just use execute
to fetch data.
history
: the history mode you can sync conditions with URL, base on vue-router (V3 & V4 support)
mutate
: use mutate
to directly modify data
- Changed
data
from shallowRef
to ref
.
queryOptions
are now removed, replace queryOptions
with config.history
. The sync
no need inject router now just use router
const router = useRouter()
// Before
Provider(router)
useConditionWatcher(
{
fetcher,
conditions,
},
{
sync: 'router'
}
)
// After
useConditionWatcher(
{
fetcher,
conditions,
history: {
sync: router
}
},
)
- Add fetch events
onFetchSuccess
, onFetchError
, onFetchFinally
onConditionsChange
return type changed.
//Before is array
onConditionsChange(([newCond, oldCond]) => {})
//After is arguments
onConditionsChange((newCond, oldCond) => {})
- Change return value
data
, error
, loading
to readonly
- Change
data
type: ref
to shallowRef
- Refactor Queue class to hook function
- Keep requests first in - first out
immediate
not working in sync router mode
- Return Value:
resetConditions
- Return Value:
onConditionsChange
- Deprecate
refresh
- You can use async & await function now in
beforeFetch
, afterFetch
.
afterFetch
should be return an data.
- Config:
initialData
- Config:
immediate
- Config:
onFetchError
- Return Value:
execute
- Requires Node.js 12.0.0 or higher
- Use stable version for vue-demi
- No sync query use vue2 vue-router
- Add query option property navigation
- Remove peer dependency
- Modify readme
- Add function
afterFetch
and return data
.
- Add demo for vue2 with vue-infinite-scroll
- Check new condition and prev condition is equivalent before fetch data. (24680f2)
- Move rfdc to dependencies.
- Update vue-demi version
- Fix history back and forward bug (f997f31)
- If not use router, fetch data when instance created (0f7daba)
- Remove watchEffect, change use watch (fa0f03e)
- Add vue2 with vue-composition-api example
- support vue2 with vue-composition-api
- Update Vue to beta 18
- Use vue-demi to support vue2.x
- Update Vue to beta 16
- Update Vue Router to Alpha 13
- Sync the state with the query string and initialize off of that so that back/forward work.
- Sync the state with the query string and initialize off of that so that refresh work.
(back/forward) not finish
- loading state should return true when fetching data (1bf4e93)
- use rdfc deep copy conditions (1bf4e93)
- rename beforeFetchData to beforeFetch (2450c1d)