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

Tags: add shorthand functions for easier usage and readability #122

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

bryanmontz
Copy link
Collaborator

We can now optionally use shorthand functions for creating tags.

let tag = Tag.pubkey(<pubkey hex>)

let tags: [Tag] = [.pubkey(<pubkey hex>)]

I created these functions for tags that are used frequently, but more could be added. The regular initializer is unchanged and can still be used when desired.

@bryanmontz bryanmontz self-assigned this Dec 19, 2023
@bryanmontz bryanmontz requested a review from tyiu December 19, 2023 13:34
Copy link
Contributor

@tyiu tyiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner. Thanks!

@tyiu tyiu merged commit 892acad into main Dec 19, 2023
4 checks passed
@tyiu tyiu deleted the montz/more-tags branch December 19, 2023 13:41
RandyMcMillan pushed a commit to RandyMcMillan/nostr-sdk-ios that referenced this pull request Sep 1, 2024
…-sdk#122)

* added Tag shorthand functions for easier usage and readability

* use allValues shorthand for filtering tags
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