aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/framework/src/actions/snackbarActions.ts
blob: c5bf9278b2fd4ea830b50e9936c3f1d78f5ec63f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Action } from '../flux/action';
import { SnackbarItem } from '../models/snackbarItem';
import { Omit } from '@material-ui/core';

export class AddSnackbarNotification extends Action {

  constructor(notification: Omit<SnackbarItem, 'key' >) {
    super();

    this.notification = { ...notification, key: (new Date().getTime() + Math.random()) }
  }

  public notification: SnackbarItem
}

export class RemoveSnackbarNotification extends Action {
  constructor(public key: number) {
    super();
  }
}