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

Add convenience methods to mutator and other updates #5

Merged
merged 2 commits into from
May 6, 2020

Conversation

wschurman
Copy link
Member

Why

This PR does a few things:

  • Adds convenience methods to mutator to update enforcing so that a wrap with enforceAsyncResult isn't needed at the callsite. I've noticed this to be a common thing in usage.
  • Adds setFieldWithBlock method to update mutator which allows setting a field with a function from current field value to new field value.
  • Make ViewerContext not abstract. There's no reason this can't be concrete, and it'll help in tests.
  • Disallow imports from index.ts since it just is cleaner IMO.

How

  • Add features
  • Add tests

Test Plan

Run tests

@wschurman wschurman requested a review from ide May 5, 2020 18:32
packages/entity/src/EntityMutator.ts Outdated Show resolved Hide resolved
packages/entity/src/EntityMutator.ts Outdated Show resolved Hide resolved
@ide
Copy link
Member

ide commented May 6, 2020

Disallow imports from index.ts since it just is cleaner IMO.

Also mitigates cycles (which we can handle in most cases but generally nicer to avoid).

@wschurman wschurman merged commit 274bbd8 into master May 6, 2020
@wschurman wschurman deleted the @wschurman/version branch May 12, 2020 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants