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

feat(rich-text-links): improve getRichTextEntityLinks() #738

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcogrcr
Copy link

WHAT?

Improve the implementation of getRichTextEntityLinks() so that instead of receiving a type?: string, it receives
...type: (BLOCKS | INLINES | string)[].

WHY?

When specifying the type parameter. Most often than not, there's a need to filter on more than one type. Before this change, users were forced to call getRichTextEntityLinks() for each type. By accepting multiple values, a single invocation can get all the desired output more efficiently.

As for the BLOCKS | INLINES in addition to string, it's merely used for documentation reminding library users that they can specify the values in there, rather than explicit string values.

HOW?

yarn build && yarn test && yarn lint && yarn prettier:check

WHAT?

Improve the implementation of `getRichTextEntityLinks()` so that instead
of receiving a `type?: string`, it receives
`...type: (BLOCKS | INLINES | string)[]`.

WHY?

When specifying the `type` parameter. Most often than not, there's a
need to filter on more than one `type`. Before this change, users were
forced to call `getRichTextEntityLinks()` for each type. By accepting
multiple values, a single invocation can get all the desired output more
efficiently.

As for the `BLOCKS | INLINES` in addition to `string`, it's merely used
for documentation reminding library users that they can specify the
values in there, rather than explicit string values.

HOW?

`yarn build && yarn test && yarn lint && yarn prettier:check`
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.

1 participant