nostr
package: delegation
#521
No reviewers
Labels
No Label
1000k
100k
10k
200k
20k
500k
50k
5k
75k
backend
blocked:design
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
scope:intl
scope:nip
scope:query_tracing
scope:ux
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Kieran/snort#521
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "nostr-package-delegation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add delegation. Refactor the event types into classes with an
EventCommon
base class that contains some common methods. Get rid ofRawEvent
. TheEventCommon
type should not be exposed to the user - hopefully this is doable. If this is not doable, then I will refactor it away. Its only purpose is to allow some code to be "easily reused" - it's not necessary for type correctness and it has no utility beyond reusing code.There are two more things to do to make these classes more ergonomic:
TextNote.create
,SetMetadata.create
). All parameters should be optional, and the ones that are common to all factory methods can be moved into their own type and reused in every factory method.userMetadata
getter of theSetMetadata
event does some validation and throws ifthis.content
is invalid. This pattern repeats in all events. These kinds of validation should instead be done in the event constructor.Also as finishing touches, much of the docs of this lib will need to be vastly improved in the future. Not sure how close I am to that :-)
Deploying with Cloudflare Pages
392dcc2
View logs
Pull request closed