8000
Skip to content

Clearing empty Set&Map should be noopย #680

@nifgraup

Description

@nifgraup

๐Ÿ› Bug Report

To Reproduce

const { produce, enableMapSet } = require("immer");
enableMapSet();
const map = new Map();
const newMap = produce(map, draft => { draft.clear(); });
map === newMap

Observed behavior

false

Expected behavior

true

Environment

  • Immer version:
  • I filed this report against the latest version of Immer
  • Occurs with setUseProxies(true)
  • Occurs with setUseProxies(false) (ES5 only)

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

      0