1. Getting Started
2. Basic Concepts
3. Handlers
4. Advanced Concepts
Action - function(object)
# function Properties
task
{
"name": "string"
}
"Data-Handler"
tasks
Array<object>
request
object
error
object
loader
bool
callback
object
filter
Array<string> │ Array<Array<string>>
task - object
# task Properties
name
"Data-Handler" │ "Infinite-Handler" │ "Delete-Handler" │ "Update-Handler" │ "Update-Key-Handler" │ "Toggle-Key-Handler" │ "Splice-Data-Handler" │ "Delete-Key-Handler" │ "Don't-Update-Data-Handler" │ "Custom-Handler"
"Data-Handler"
clearData
true │ false
false
subKey
Array<string>
isAppendTop
true │ false
deleteKey
Array<string │ Array<string>>
id
number │ string │ Array<string> │ Array<number>
key
string
spliceKey
Array<number>
toggleKey
true │ false
updateCallback
func
request - object
# request Properties
query
object
params
object
payload
object
axiosConfig
object
paramSerializer
object
{ arrayFormat: "brackets" }
asyncFunction
func
asyncFunctionParams
array
retry
bool
0
errorParser
bool
false
polling
bool
false
pollingCount
number
delay
number
8000
clearDataOnError
bool
false
errorDataHandling
bool
true
defaultErrorParser
bool
false
Callback - object
# callback Properties
successCallback
func
errorCallback
func
finalCallback
func
pollingCallback
func
updateStateCallback
func
# task - <Object>
Props | Description | value | Default Value | type | usage |
---|---|---|---|---|---|
name | Type of task to execute | Data-Handler Infinite-Handler Delete-Handler Callback-Handler Update-Handler Update-Key-Handler Toggle-Key-Handler Splice-Data-Handler Delete-Key-Handler Don't-Update-Data-Handler Custom-Handler | Data-Handler | string | { name: 'Data-Handler' } |
clearData | clear previous stored data | true or false | false | boolean | { clearData: true } |
subKey | for doing various tasks on deep object | [] | null | array | { subKey: ['data','filter-1'] } |
limit | number | null | number | { name: 'Infinite-Handler', limit: 15 } | |
isAppendTop | true or false | false | boolean | { isAppendTop: true } | |
deleteKey | [] | null | array | { deleteKey: ['age','name'] } | |
id | [] | null | array | { id: [1,2] } | |
key | string | null | string | { key: 'id' } | |
spliceKey | [2,4] | null | array | { spliceKey: [2,4] } | |
toggleKey | [] | null | array | { toggleKey: ['age','name'] } | |
values | [] or {} | null | array or object | {values: {2: {name: 'ram'}}} {values: [{name: 'sundar'}]} | |
updateCallback | function | null | function | {updateCallback: (previousData,responseData) => previousData.concat(responseData)} | |
callback | function | null | function | {callback: (previousData,responseData) => previousData.concat(responseData)} |
# request - <Object>
Props | value | Default Value | type | usage |
---|---|---|---|---|
query | {} | null | object | {query: { id: 20 }} |
params | {} | null | object | {params: { id: 20 }} |
payload | {} | null | object | {payload: { id: 20 }} |
axiosConfig | {} | null | object | {headers: {} } |
paramSerializer | {} | { arrayFormat: 'brackets' } | object | `{ arrayFormat: 'comma |
asyncFunction | function | null | function | {asyncFunction : async (url) => fetch(url)} } |
asyncFunctionParams | array | null | array | {asyncFunctionParams: ['https://www.example.com/']} |
retry | number | 0 | number | {retry: 3} |
errorParser | function | null | function | {errorParser: () => {}} |
polling | boolean | false | boolean | {polling: true} |
pollingCount | number | Infinite | number | {pollingCount: 4} |
delay | number | 8000 | number | {delay: 10000} |
clearDataOnError | boolean | false | boolean | {clearDataOnError: false} |
errorDataHandling | boolean | true | boolean | {errorDataHandling: false} |
defaultErrorParser | boolean | false | boolean | {defaultErrorParser: true} |
onCancelTask | function | null | function | {onCancelTask: () => {cancelfunction()} } |
axios | function | null | function | {axios: axiosInterceptor } |
useCache | Boolean | null | Boolean | {useCache: true } |