Skip to content

Commit

Permalink
fix: vue exports
Browse files Browse the repository at this point in the history
  • Loading branch information
davay42 committed Apr 27, 2023
1 parent a289a29 commit 6ef0ba1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h1>Chat example app!</h1>
<p> {{message}} </p>
<user-icon></user-icon>
<chat-room topic="Example chat"></chat-room>

</div>

</body>
Expand Down
9 changes: 5 additions & 4 deletions examples/composables.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@
}
</script>
<script type="module">
import {useUser, SEA, useRoom, useRelay} from "@gun-vue/composables"
import {useUser, SEA, useRoom, useRelay, vue} from "@gun-vue/composables"
const {user, auth} = useUser()
const {room} = useRoom()
const {relay} = useRelay()

setTimeout(async () => {
await login()
vue.watchEffect(() => {
document.getElementById('pubKey').innerText = user.pub
document.getElementById('roomName').innerText = room.profile?.name
document.getElementById('roomKey').innerText = room.pub
document.getElementById('relay').innerText = relay.peer
}, 100)
})

await login()

async function login() {
if (user.is) return console.log('reused user')
Expand Down

0 comments on commit 6ef0ba1

Please sign in to comment.