New source found from dndbeyond.com
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
||||
var weakMemoize = function weakMemoize(func) {
|
||||
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
||||
var cache = new WeakMap();
|
||||
return function (arg) {
|
||||
if (cache.has(arg)) {
|
||||
// $FlowFixMe
|
||||
// Use non-null assertion because we just checked that the cache `has` it
|
||||
// This allows us to remove `undefined` from the return value
|
||||
return cache.get(arg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user