blob: a96e6550f2ef76a43003e3c71a43a6f854e67328 (
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: string = '';
message: string = '';
type: string = 'primary';
sticky: bool = 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;
}
}
|