summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/models/SummaryPart.js
blob: 89c76d4a0b7b4404a6d5dc16404b14389a046970 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const { Record, List } = require('immutable');
const SummaryArticle = require('./SummaryArticle');

class SummaryPart extends Record({
    title:    '',
    articles: List()
}) {
    constructor(state) {
        super({
            ...state,
            articles: (new List(state.articles))
                .map(article => new SummaryArticle(article))
        });
    }
}

module.exports = SummaryPart;