effector / effector/farfetched

Add opportunity to directly assign `undefined` for optional properties

Open
#438 1 comment 0 reactions 0 assignees View on GitHub
needs triage scope:core
Dominant language
TypeScript
Stars
221
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Right now, we cannot assign the undefined property value, even if it is optional. So it forces to write additional boilerplate to return empty object instead of undefined property. For example:

``` js
const getProperty = () => {
if (condition) {
return { property };
}

return {};
}

...

request: {
...getProperty()
...
}

// instead of

request: {
property: condition ? property : undefined
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.