Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellamaki authored May 14, 2021
1 parent 9d8c373 commit 4e4711f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/hashi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In practice, this means that apps can be developed to use Kolibri content. For e

### What would the user experience?

When a user has permissions to access a custom channel, and they click on it in the main learn tab, rather than viewing "normal Kolibri," they will experience a full-screen HTML5 app. Through the functionality provided by the API, they can interact with content within the app, and hashi will act as a "bridge" - collecting information about the user's interactions (such as clicking on a link), requesting data from the Kolibri database based on the type of interaction, and passing the requested data back to the app. One "out-of-the-box" user interaction is the "navigateTo()" function, which opens a modal that displays a content node. For other data fetching requests, the app, not Kolibri, has the responsibilty of determining what to do with that data.
When a user has permissions to access a custom channel, and they click on it in the main learn tab, rather than viewing "normal Kolibri," they will experience a full-screen HTML5 app. Through the functionality provided by the API, they can interact with content within the app, and hashi will act as a "bridge" - collecting information about the user's interactions (such as clicking on a link), requesting data from the Kolibri database based on the type of interaction, and passing the requested data back to the app. One "out-of-the-box" user interaction is the `navigateTo()` function, which opens a modal that displays a content node. For other data fetching requests, the app, not Kolibri, has the responsibilty of determining what to do with that data.

Below: A gif that demonstrates navigating into a normal Kolibri channel and then the difference of navigation into a custom channel. Once in the custom channel, clicking a link to a content node opens a modal that then displays the content.

Expand Down Expand Up @@ -115,11 +115,11 @@ this.on(this.events.DATAREQUESTED, message => {

This same pattern of a message and event listener is repeated, with `mainClient.js` emitting the event and a listener registered in `CustomContentRenderer.vue`, which is where all of the helper functions that actually request data are.

On database response, either the data or an error is returned to the iframe using the datareturned event and corresponding listeners
On database response, either the data or an error is returned to the iframe using `createReturnMsg()` in `CustomContentRenderer.vue`, the datareturned event and corresponding listeners
```
this.on(this.events.DATARETURNED, message => {
this.mediator.sendMessage({ nameSpace, event: events.DATARETURNED, data: message });
});
```

Finally, `sendMessageAwaitReply()` which has been waiting, either resolves or rejects, passing the data back to the original hashi API function, which in turn is
Finally, `sendMessageAwaitReply()` which has been waiting, either resolves or rejects, passing the data back to the original hashi API function.

0 comments on commit 4e4711f

Please sign in to comment.