0.2.0 • Published 8 years ago

@mycure/vu-notifs v0.2.0

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

js-semistandard-style

MYCURE Vue Notifs module

Installation and Usage

$ yarn add @mycure/vu-notifs
  • use as a vue plugin
import Vue from 'vue';
import McNotifs from '@mycure/vu-notifs';

Vue.use(McNotifs)
  • above will do the ff:
    • describe side effects here
    • sample side effects:
      • attach a global method/attribute
      • attach an instance method/attribute
      • add components
// create sample use here

API

interface NotificationService {
  notifs$: Observable<Notification[]>
  numOfUnseen$: Observable<number>
  markAsSeen(notif: Notification): void
  next(limit?:number=10): void
  stop(): void
}

FirebaseShare

/notifications/{uid}
  /data: <id, Notification>
    {notifId}
      /id: <notifId>
      /type: NotificationType
      /title: string
      /body: string
      /createdAt: Date
      /seen: bool

  /meta
    total: number

Model

Notification

enum NotificationType {
  connection
  scheduler
  general
}

interface Notification {
  id: string
  type: NotificationType,
  title: string,
  body: string,
  createdAt: string,
  seen: bool,
  markingAsSeen: bool // for loading spinner, in-app only
}
0.2.0

8 years ago

0.1.0

8 years ago