Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

util: Cleanup CachedValue class.

Priyank Patel899d7bba5a9e
diff --git a/static/js/util.js b/static/js/util.js
index be71ff0da77..fb97234fb90 100644
--- a/static/js/util.js
+++ b/static/js/util.js
@@ -159,12 +159,12 @@ export const array_compare = function util_array_compare(a, b) {
* You must supply a option to the constructor called compute_value
* which should be a function that computes the uncached value.
*/
-const unassigned_value_sentinel = {};
+const unassigned_value_sentinel = Symbol("unassigned_value_sentinel");
export class CachedValue {
_value = unassigned_value_sentinel;
constructor(opts) {
- Object.assign(this, opts);
+ this.compute_value = opts.compute_value;
}
get() {