ledgerloops / snap-solid

SNAP in the browser, on top of Solid
2 stars 0 forks source link

relation between SnapContact and SolidContact #6

Closed michielbdejong closed 4 years ago

michielbdejong commented 4 years ago

The user has an addressbook; each entry therein has:

A SolidContact is constructed from contactSub, podData. It can send a message, with a callback (that will be called twice), and it can fetchSent and fetchReceived. This will trigger onMessage lots of times. A SnapContact is constructed from SolidContact. It can send a SnapStateTransition, and has a SnapChecker so just call loadMessages and it will load all sent and received into the SnapChecker.

SolidSnap has a singleton PodData, it exposes a getSnapContacts which calls getContacts on that, and constructs one SnapContact for each SolidContact. It also exposes addContact from PodData.