react-lazy-cache icon indicating copy to clipboard operation
react-lazy-cache copied to clipboard

Falsy values passed into fn as undefined

Open gareimer opened this issue 8 years ago • 0 comments

this.cache = lazyCache(this, {
    cachedMyProp: {
        params: ["myProp"],
        fn(myProp) {
            // prints undefined
            console.log("myProp: ", myProp);
        }
    }
})

When myProp is 0, null, or "", the value of myProp passed into fn is undefined. It should be the original prop's value.

gareimer avatar Jul 04 '17 21:07 gareimer