Skip to content

Allow setting new data based on old data #103

Open
@elsangedy

Description

@elsangedy

Now is not possible update the current data inside deferFn, I only can replace with new data.

It would be nice if deferFn get the current state or data as a parameter, this can be able implement features like infinite scroll

const deferFn  = (params, defaultParams, state, abortCtrl) => Promise.resolve([...state.data, ...newDataArray])

...

const { data, run } = useAsync({ deferFn })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions