Added libs
This commit is contained in:
15
p2post/vue/api/socketEvents.js
Normal file
15
p2post/vue/api/socketEvents.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useP2postStore } from '../stores/p2postStore'
|
||||
|
||||
const p2postStore = useP2postStore()
|
||||
|
||||
export default function registerSocketEvents(socket) {
|
||||
socket.on('connect', (data) => {
|
||||
console.log('Connected p2Post')
|
||||
}),
|
||||
|
||||
socket.on('newPost', (data) => {
|
||||
p2postStore.addPost(data)
|
||||
console.log('New Post', data)
|
||||
})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user