Skip to content

update function should accept just new data #165

@ayhanyunt12

Description

@ayhanyunt12

As per the documentation current update method accepts a callback function, we have some cases where we get the latest version of data entirely from the backend and we write logics like
promise(body).then(res => update(() => res))

Maybe changing update method can accept both of them?
update(currentData => ({ ...currentData, username: newUsername, })
update(latestData)

And usage would be more flexible.
promise(body).then(update)

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