Last active
March 10, 2019 09:48
-
-
Save mikeapr4/fe165b40e21ba3e4b3fee0d5e6f4b92b to your computer and use it in GitHub Desktop.
an example rudimentary vuex method-style getter cache - don't use this, just for illustration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mappedTask2: (state, getters) => { | |
const cache = {}; | |
return (id) => { | |
const record = state.tasks[id]; | |
const key = id + record.name; | |
if (!cache[key]) { | |
cache[key] = getters.mappedTask(id); | |
} | |
return cache[key]; | |
}; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment