memoizeGetters

node v8.17.0
version: 1.0.0
endpointsharetweet
const memoizeGetters = require('memoize-getters'); class Event { get date() { return new Date(); } } // lets create a new class that'll have all getters be memoized const MemoizedEvent = memoizeGetters(class MemoizedEvent extends Event {});
let event = new MemoizedEvent(); // these two should be equal because the value is cached event.date === event.date
Loading…

no comments

    sign in to comment