neighbour-hoods / nh-launcher

Creating a group coherence with holochain apps
Other
4 stars 3 forks source link

Make Sensemaker store methods return an EntryRecord (where they currently return an entry) #126

Open nick-stebbings opened 10 months ago

nick-stebbings commented 10 months ago

Sensemaker store methods should consistently return similar data structures unless there is a good reason to not return that data structure. The basic unit should be a EntryRecord<X>. If it's async, it should be a Promise<EntryRecord<X>>. If there are multiple objects, it should be a Promise<Array<EntryRecord<X>>>

Please update:

nick-stebbings commented 7 months ago

updateAppletConfig is actually just a store update, no entry is created and so this will be an outlier. Maybe the method needs renaming to make this clear?

nick-stebbings commented 7 months ago

for getAssessmentsForResources.. currently we are getting back a Record<EntryHashB64, Array<Assessment>>>. Can you please clarify what is the requested return type for this instead? If we are needing an array of EntryRecord<Assessment> as the value of the Record, it will mean changes to multiple zome functions so I just wanted to clarify first.

nick-stebbings commented 7 months ago

for setAssessmentWidgetTrayConfig, I assume this may as well wait for getAssessmentWidgetTrayConfig to be changed as you described in the comment?

All of the above also invalidates the README for sensemaker client. It was already quite out of date, shall we set that up as a separate task involving changing the reported return types?

@adaburrows If you can clarify the above few questions I can move to close off this issue.