1.0.2 • Published 2 years ago

vue-signaler v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vue-signaler

A tiny eventbus library for vue 3

  • It provides a plugin and composables for using event bus
  • just simply plug it with your vue and it will take care of everything
  • it's only 300 bytes (gzip)

installation

npm i vue-signaler

usage

To use the library in Vue 3

In the main.js file, import the eventBus and use it as plugin

<script>

import { eventBus } from 'vue-signaler'

app.use(eventBus)

</script>

In the components, we can access the eventBus using the composable useEventBus

<script>
import { useEventBus } from 'vue-signaler'

const { eventBus } = useEventBus();

eventBus.on('eventName', (data)=>{
  console.log(data)
})

eventBus.emit('eventName' , { name : 'rogue-striker' })

</script>
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.1.0-beta

2 years ago

1.0.0-beta

2 years ago