pinafore/routes/_utils/thunk.js
Nolan Lawson 5c53199434 lint fix
2018-02-21 17:57:49 -08:00

12 lines
158 B
JavaScript

export function thunk (fn) {
let value
let called
return () => {
if (!called) {
value = fn()
called = true
}
return value
}
}