JSPM

ry-notification-center

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q34535F
  • License MIT

Implement NotificationCenter design mode from Objective-C/Swift with typescript.

Package Exports

  • ry-notification-center

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ry-notification-center) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

RYNotificationCenter

Implement NotificationCenter design mode from Objective-C/Swift with typescript.
Manage multiple event emiters with singleton NotificationCenter to simplify notification push/observe logic.

Install with npm

npm install ry-notification-center@latest

How to use

  //Add observer in page/component/plugin init method
  ionViewDidLoad() {
    RYNotificationCenter.default.addObserver(this, "NotificationKey", (notification) => {
    // callback when received notification
    })
  }

  //Remove observer in page/component/plugin dealloc method
  ionViewWillUnload() {
    RYNotificationCenter.default.removeObserver(this)
  }