reactiveCache.js 375 B

1234567891011121314
  1. import { DataCache } from 'meteor-reactive-cache';
  2. // global Reactive Cache class to avoid big overhead while searching for the same data often again
  3. ReactiveCache = {
  4. getBoard(id) {
  5. if (!this.__board) {
  6. this.__board = new DataCache(boardId => {
  7. return Boards.findOne(boardId);
  8. });
  9. }
  10. const ret = this.__board.get(id);
  11. return ret;
  12. }
  13. }