erikras / erikras/react-lazy-cache

Falsy values passed into fn as undefined

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
44
Forks
6
PR merge metrics
No merged PRs in 30d

Description

```javascript
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.