Move every Cards.findOne() to the ReactiveCache

This commit is contained in:
Martin Filser 2022-12-16 16:36:47 +01:00
parent a182482cfb
commit 3b65113d05
24 changed files with 96 additions and 87 deletions

View file

@ -1,3 +1,5 @@
import { ReactiveCache } from '/imports/reactiveCache';
function getCardsBetween(idA, idB) {
function pluckId(doc) {
return doc._id;
@ -13,7 +15,7 @@ function getCardsBetween(idA, idB) {
}).map(pluckId);
}
const cards = _.sortBy([Cards.findOne(idA), Cards.findOne(idB)], c => {
const cards = _.sortBy([ReactiveCache.getCard(idA), ReactiveCache.getCard(idB)], c => {
return c.sort;
});