Immutable.Map.deleteAll() is not a function

让人想犯罪 __ 提交于 2019-11-29 07:37:40

Looks like it's only been added on the latest version (ver. 4 RC1 & RC2). I looked over the src code and it's not found in the 3.8.1. Unless you want to use 4.0.0-rc.2, there's no other way to use that method yet.

As mentioned, deleteAll is only in the release candidate. You can get the same result with ...

const mutated = ['name', 'age'].reduce((map, key) => map.delete(key), person);

I think you should be using deleteIn?

https://facebook.github.io/immutable-js/docs/#/Map/deleteIn

person.deleteIn(['name', 'age']);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!