Skip to content

Question about ephemera usage #6799

Answered by turadg
tgrecojs asked this question in Q&A
Jan 12, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

provideEphemera is the function returned by makeEphemeraProvider which holds the "ephemeras" in a closure

const ephemeras = new Map();

Each ephemera object holds references that can be lost and the object is keyed by whatever was passed to provideEphemera. In this case it's holderId. (Though in master at the moment it's subscriber which is 1:1 with the holder object).

The object on line 53 isn't strictly necessary. Those lines could be,

Object.assign(provideEphemera(holderId), { subscriber, publisher }); 

The values written into the ephemera object are read without binding an ephemera const. E.g.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@tgrecojs
Comment options

@tgrecojs
Comment options

@turadg
Comment options

turadg Jan 16, 2023
Collaborator

@tgrecojs
Comment options

Answer selected by tgrecojs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #6780 on January 16, 2023 01:26.