MCPcopy Create free account
hub / github.com/pacexy/flow / constructor

Method constructor

apps/reader/src/models/reader.ts:452–461  ·  view source on GitHub ↗
(
    tabs: Array<Tab | TabParam> = [],
    public selectedIndex = tabs.length - 1,
  )

Source from the content-addressed store, hash-verified

450 tabs: Tab[] = []
451
452 constructor(
453 tabs: Array<Tab | TabParam> = [],
454 public selectedIndex = tabs.length - 1,
455 ) {
456 this.tabs = tabs.map((t) => {
457 if (t instanceof BookTab || t instanceof PageTab) return t
458 const isPage = typeof t === 'function'
459 return isPage ? new PageTab(t) : new BookTab(t)
460 })
461 }
462
463 get selectedTab() {
464 return this.tabs[this.selectedIndex]

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected