I find it strange, that there’s no method for deleting an item from the dict. It looks like I need to use something like Js.Dict | ReScript API, but it’s only for the Js.Dict.t.
Ok, I understood why there’s no such a method.
It looks like I need to play around with functors or create the method for every dict I have in my program.
Is there a better solution for this?
You can define the delete
function in an external JS file and add a binding to it
Are you required to use a native JS object? You could consider a MutableMap
if not which, as you mention, uses functors for type safety.
Thank you very much! Both of your suggestions are great. You’re right the MutableMap will suit me, I’m just used to using regular objects in js. Also the solution for the type warning is very nit