-
Haiku x86_64 hrev53112
```rst
================================
gc 8.0.4: ./test-suite.log
================================
# TOTAL: 16
# PASS: 14
# SKIP: 0
# XFAIL: 0
# FAIL: 2
# X…
-
在学习[缓存函数](https://whatthefork.is/memoization)时,最后提到了**WeakMap方式缓存(对入参类型为对象做缓存,并且当对象在WeakMap中的key没有引用时方便浏览器垃圾回收)**
>If our parameter were an object (rather than a string, like it is above), we could…
-
-
## 前言
我们先从 WeakMap 的特性说起,然后聊聊 WeakMap 的一些应用场景。
## 特性
### 1. WeakMap 只接受对象作为键名
```js
const map = new WeakMap();
map.set(1, 2);
// TypeError: Invalid value used as weak map key
map.set(n…
-
This might be an ever-moving goal post to get the compiled and interpreter environments identical, but doing some tests to illuminate what's available in the globals in the different environments.
…
-
Using `kadira:flow-router-ssr@3.13.0`, when rendering the component https://github.com/davidchin/react-input-range (`0.8.0`), on the server side, I get that
```
ReferenceError: WeakMap is not defined…
-
How can I import memoizee in typescript?
(var memoize = require("memoizee/weak"); in JS)
@types/memoizee does not seems to have any "WeakMap" variant.
-
First off, thank you for creating this tool! It works amazingly well, and solves many of the problems with working with heap snapshots that I mentioned in [my blog post](https://nolanlawson.com/2020/0…
-
-
Is the use of Map and WeakMap necessary? I recently added error tracking to our site and found out that old clients barf on these requirements. The alternative is of course to polyfill, but that shoul…