Skip to content

getState & restoreState do not consistently deep copy. #111

@milescrawford

Description

@milescrawford

getState's documentation says that it makes a deep copy, but restoreState does not make a copy when you pass this back in.

So, if you store a state, restore a board to that state, and modify the board, your stored state is mutated. This makes it very difficult to maintain a history, or keep a permanently-stored state that you revert to more than once.

See this JS fiddle for an example: https://jsfiddle.net/czjxue6y/4/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions