I kinda hate this, especially if I have to write code like this all over the place. Now ideally, I want to just put a predicate to the card so I implement it once and can just call
const isSlow = card.isSlow();
const isSlow = card.isSlow();
Is this possible with interfaces at all? Like an abstract prototype-ish implementation?
Some caveats: - I cannot use classes, cause that messes up my Redux state management and jsonifying states in general. - I also considered utility classes like
cardFunctions
cardFunctions
then I guess you could do
import { isSlow } from "./cardFunctions";const isSlow = isSlow(card);
import { isSlow } from "./cardFunctions";const isSlow = isSlow(card);
not the biggest fan but if that's the best there is I might go for it