Function

import { getValue } from '@glimmer/tracking/primitives/cache';

Gets the value of a cache created with createCache.

1
2
3
4
5
6
7
8
9
10
import { tracked } from '@glimmer/tracking';
import { createCache, getValue } from '@glimmer/tracking/primitives/cache';

let computeCount = 0;

let counter = createCache(() => {
  return ++computeCount;
});

getValue(counter); // 1