Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lens): remove optional types from proxy result #36

Merged
merged 1 commit into from
Aug 27, 2018

Conversation

Ailrun
Copy link
Owner

@Ailrun Ailrun commented Aug 27, 2018

Description

Optional type make problem with following example.

type Example = {
  key?: string;
};

const exampleLens = new LensGenerator<Example>().byProxy();
// TS emit an error with message `Object is possibly 'undefined'`
example.key.set()({})('abc');

This change will not make any problems with following case, since type parameters for LensSProxy will include undefined as a value of key.

example.key.set()({ key: 'abc' })(undefined);

@Ailrun Ailrun added the PR: fix bug 🛠️ PR fixing some bugs label Aug 27, 2018
@Ailrun Ailrun added this to the 0.4.0 milestone Aug 27, 2018
@Ailrun Ailrun self-assigned this Aug 27, 2018
@Ailrun Ailrun force-pushed the fix/lens-undefined-proxy-type branch from 394d13a to 49b5a5f Compare August 27, 2018 08:02
@Ailrun Ailrun merged commit 81c651b into master Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix bug 🛠️ PR fixing some bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant