vue-bus3
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

vue-bus3

A package project View docs

Build NPM

Installation

NPM / Yarn:

yarn add vue-bus3

CDN:

<script src="https://unpkg.com/vue-bus3"></script>

Example

main.ts

// your example
import { createBus } from "vue-bus3";

const bus = createBus<{
  "hide-comment": void
}>

app.use(bus);

App.vue

import { useBus } from "vue-bus3"

const bus = useBus()

bus.on("hide-comment", () => {
    console.log("hide-comment")
})

bus.emit("hide-comment")

Declare event types

bus.d.ts

import "vue-bus3"

declare module "vue-bus3" {
    interface TypeEventsGlobal {
        "hide-comment": void
    }
}

Readme

Keywords

Package Sidebar

Install

npm i vue-bus3

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

14.1 kB

Total Files

10

Last publish

Collaborators

  • tachibana-shin