aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/News.js
blob: caf1d70e5d137a35a91b3739a674049977b57975 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// @flow

export default class News {
  id = '';
  message = '';
  type = 'primary';
  sticky = false;

  constructor(data) {
    if (!data.id) {
      throw Error('News requires Id');
    }

    this.id = data.id;
    this.message = data.message || this.message;
    this.type = data.type || this.type;
    this.sticky = data.sticky !== undefined ? data.sticky : this.sticky;
  }
}