Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventService

Hierarchy

Index

Constructors

constructor

Methods

create

  • Parameters

    Returns Promise<IResult<IEvent>>

    Response wrapped in IResult

    Example

    
     const mandantoryObject: IEvent = {
       source: device,
       text: 'I am an Event!',
       time: '2018-05-02T10:08:00Z',
       type: 'device-type-here',
     };
    
     (async () => {
       const {data, res} = await eventService.create(mandantoryObject);
     })();
    

delete

  • Parameters

    Returns Promise<IResult<null>>

    Response wrapped in IResult

detail

  • Parameters

    Returns Promise<IResult<IEvent>>

    Response wrapped in IResult

    Example

    
       const eventId: number = 1;
    
       (async () => {
         const {data, res} = await eventService.detail(eventId);
      })();
    

list

list$

  • Parameters

    Returns Observable<IEvent[]>

    Data wrapped as Observable.

    Example

    
      const list$ = eventService.list$();
      list$.subscribe((data) => console.log(data));
    

    Deprecated This function will be removed soon in favor of decoupling this library from rxjs. Use Realtime for realtime connection and rxjs defer() or from() to composite an observable on your own.

listBySource$

  • Parameters

    Returns Observable<IEvent[]>

    Data wrapped as Observable.

    Example

    
      const listBySource$ = eventService.listBySource$(11);
      listBySource$.subscribe((data) => console.log(data));
    

    Deprecated This function will be removed soon in favor of decoupling this library from rxjs. Use Realtime for realtime connection and rxjs defer() or from() to composite an observable on your own.

update

  • Parameters

    Returns Promise<IResult<IEvent>>

    Response wrapped in IResult

    Example

    
     const partialUpdateObject: Partial<IEvent> = {
       source: device,
       text: 'Changed Event!'
     };
    
     (async () => {
       const {data, res} = await eventService.update(partialUpdateObject);
     })();
    

Generated using TypeDoc