-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API change: resolve WebSdkApi.connect() only once connection established and agent available #104
Comments
Hey @mattyg - The code in that example is very bad. I recently decided to just take it out of the docs, as despite the warning, I've seen it replicated many times when someone has implemented holo in their happ (understandably, it's in the README). But that's slightly orthogonal to your suggestion. One reason for returning immediately from |
But in practice you're going to be calling <template>
<div v-if="loading">Loading...</div>
<MyApp v-else />
</template>
<script lang="ts" setup>
const loaded = ref(false);
onMounted(() => {
setupClient();
});
const setupClient = async () => {
await WebSdkApi.connect(...);
loaded.value = true;
}
</script> This is how you would do it with the holochain client, right? Does it make sense to require more code to setup the two clients differently? |
It's seems very weird to me that
WebSdkApi.connect()
resolves before the agent is actually available, so we have to do this (from the README):Instead
connect()
should just not resolve the promise until the agent is available (or preferablysignUp()
should not resolve until the agent is available #102).The text was updated successfully, but these errors were encountered: