Skip to content

Reassigning variable used as action should be reactive and destroy old action #6754

Closed as not planned
@lukaszpolowczyk

Description

@lukaszpolowczyk

Describe the bug

When I change a function in use:action to something else, destroy neither executes nor adds the other action.

Putting an item in #key helps.

Actually, I'd like to be able to replace a function in use:action without a #key, because #key is a more drastic solution than simply executing destroy and adding a new action.

Reproduction

Described example:
https://svelte.dev/repl/730c59ca84e8486aa67108a0d4544bbc?version=3.42.6

  1. Click "remove action" in First case - does nothing and should execute destroy.

  2. Click "remove action" in Second case - When you use #key, destroy is executed.

Logs

No response

System Info

System:
    OS: Linux 5.10 Arch Linux
    CPU: (4) x64 AMD Athlon(tm) X4 950 Quad Core Processor
    Memory: 2.60 GB / 15.07 GB
    Container: Yes
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 16.3.0 - /usr/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 7.17.0 - /usr/bin/npm
  Browsers:
    Firefox: 87.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions