Visitar URL original
[task]: Add a "reset" method. · Issue #5352 · lit/lit · GitHub
Skip to content

[task]: Add a "reset" method. #5352

Open

Description

@jamestalmage

Should this be an RFC?

  • This is not a substantial change

Which package is this a feature request for?

Task (@lit/task)

Description

Use case:
I am implementing a form handler which, upon submission, fires off a task which may succeed or fail (using autoRun:false and calling run manually). Upon failure, I render whatever the appropriate error message is. If they start typing / modifying fields again, I'd like to immediately put the task back in the initial state.

I propose a reset() method that resets all internal state to the initial state.

Alternatives and Workarounds

I could certainly add state fields to the enclosing component to handle this, but then I've got to manage that state field and make sure I'm thinking through all the edge cases.

Activity

  1. dushyantpant5 commented on Jul 29, 2026

    @dushyantpant5

    @jamestalmage Can i pick this ?

  2. jamestalmage commented on Jul 29, 2026

    @jamestalmage
    Author

    @jamestalmage Can i pick this ?

    I don't know what you mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions