aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/News.js
blob: acacb97dd1ab513745f34c06574e20c9df1e014d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// @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;
  }
}