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

Make resolved entity assertions iterable #114

Open
MichaelHirn opened this issue Sep 13, 2019 · 0 comments
Open

Make resolved entity assertions iterable #114

MichaelHirn opened this issue Sep 13, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request refactor rlay-client-lib issues pertaining to @rlay/rlay-client-lib
Milestone

Comments

@MichaelHirn
Copy link
Contributor

Calling .resolve on an entity (Individual) leads to all (property and assert) assertions being fetched, decoded, and attached to the entity. However, if there is only assertion that has the same assertion property it will be attached like this entity.customKeyAssertionName instanceof Object || instanceof {String|Boolean|Numeric|...} and if there are two or more assertions that share the same assertion property it will be attached like this entity.customkeyAssertionName instanceof Array.

This causes ugly boilerplate when trying to use the value and to fix that we need to make it always return an iterable object e.g. an array. That object may have some helper methods like .getFirst to make it easier to access when there is only a single assertions

@MichaelHirn MichaelHirn added enhancement New feature or request rlay-client-lib issues pertaining to @rlay/rlay-client-lib refactor labels Sep 13, 2019
@MichaelHirn MichaelHirn added this to the v0.3.0 milestone Sep 13, 2019
@MichaelHirn MichaelHirn self-assigned this Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor rlay-client-lib issues pertaining to @rlay/rlay-client-lib
Projects
None yet
Development

No branches or pull requests

1 participant