Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/navigation/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ interface ViewData {
* haven't customized their sorting column
*/
defaultSortKey?: string

/**
* Method called to load child views if any
*/
// eslint-disable-next-line no-use-before-define
loadChildViews?: (view: View) => Promise<void>
}

export class View implements ViewData {
Expand Down Expand Up @@ -157,6 +163,10 @@ export class View implements ViewData {
return this._view.defaultSortKey
}

get loadChildViews() {
return this._view.loadChildViews
}

}

/**
Expand Down Expand Up @@ -222,5 +232,9 @@ const isValidView = function(view: ViewData): boolean {
throw new Error('View defaultSortKey must be a string')
}

if (view.loadChildViews && typeof view.loadChildViews !== 'function') {
throw new Error('View loadChildViews must be a function')
}

return true
}