blob: 43911410ad7dcb62b6b3c8eabcf7714c9d77413c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import Thing from './thing.js';
export class NewsEntry extends Thing {
static [Thing.referenceType] = 'news-entry';
static [Thing.getPropertyDescriptors] = () => ({
// Update & expose
name: Thing.common.name('Unnamed News Entry'),
directory: Thing.common.directory(),
date: Thing.common.simpleDate(),
content: Thing.common.simpleString(),
// Expose only
contentShort: {
flags: {expose: true},
expose: {
dependencies: ['content'],
compute: ({content}) => content.split('<hr class="split">')[0],
},
},
});
}
|