0.0.5 • Published 3 years ago

@litt1e-p/notification-center v0.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

NotificationCenter

NotificationCenter for vue which is base on publish-subcribe pattern and Vue emitter

Installation

npm i @litt1e-p/notification-center --save

Usage

import { NotificationCenter } from '@litt1e-p/notification-center'

// 1. add observer
NotificationCenter.$addObserver('noticeName', cb)

// 2. post a message
NotificationCenter.$post('noticeName', someMessage)

// 3. remove an observer when destroy
NotificationCenter.$removeObserver('noticeName', cb)


function cb (msg) {
  console.info(msg)
}
/////

for more usage

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago