2019-09-29 00:30:56 +02:00
|
|
|
/*
|
2020-02-11 11:05:21 +01:00
|
|
|
* Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
2019-09-29 00:30:56 +02:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
* IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
// TODO: remove this after we finished refactoring
|
2019-12-20 18:03:31 +01:00
|
|
|
// tslint:disable
|
|
|
|
|
2020-02-10 18:32:28 +01:00
|
|
|
import "../stylesheets/app.scss"
|
|
|
|
import "../stylesheets/app-palette.scss"
|
|
|
|
|
2020-02-14 11:33:59 +01:00
|
|
|
import { identity, values } from "ramda"
|
2019-12-17 09:53:16 +01:00
|
|
|
import {
|
2019-12-20 18:03:31 +01:00
|
|
|
EMPTY,
|
2019-12-17 09:53:16 +01:00
|
|
|
merge,
|
2020-01-08 18:17:19 +01:00
|
|
|
of,
|
2020-02-13 18:50:39 +01:00
|
|
|
fromEvent
|
2019-11-27 19:12:49 +01:00
|
|
|
} from "rxjs"
|
2019-12-17 09:53:16 +01:00
|
|
|
import {
|
|
|
|
delay,
|
|
|
|
filter,
|
|
|
|
map,
|
|
|
|
switchMap,
|
2020-02-14 11:33:59 +01:00
|
|
|
tap
|
2019-11-27 19:12:49 +01:00
|
|
|
} from "rxjs/operators"
|
2019-11-22 18:42:25 +01:00
|
|
|
|
2019-11-18 21:24:56 +01:00
|
|
|
import {
|
2019-12-22 17:30:55 +01:00
|
|
|
mountHero,
|
|
|
|
mountTabs,
|
2019-12-18 17:14:20 +01:00
|
|
|
} from "./components"
|
2019-09-29 00:30:56 +02:00
|
|
|
import {
|
2019-12-18 17:14:20 +01:00
|
|
|
getElement,
|
|
|
|
watchToggle,
|
2020-01-08 18:17:19 +01:00
|
|
|
getElements,
|
2020-01-26 16:03:49 +01:00
|
|
|
watchMedia,
|
2020-02-12 19:13:03 +01:00
|
|
|
watchDocument,
|
|
|
|
watchLocationHash,
|
|
|
|
watchViewport,
|
2020-02-13 18:29:44 +01:00
|
|
|
watchKeyboard,
|
|
|
|
watchToggleMap,
|
2020-02-14 11:33:59 +01:00
|
|
|
useToggle
|
2020-02-12 19:13:03 +01:00
|
|
|
} from "./observables"
|
2020-02-13 18:29:44 +01:00
|
|
|
import { setupSearchWorker } from "./workers"
|
2019-12-24 17:59:26 +01:00
|
|
|
import { renderSource } from "templates"
|
2020-02-14 14:47:44 +01:00
|
|
|
import { fetchGitHubStats } from "integrations/source/github"
|
2020-02-12 19:13:03 +01:00
|
|
|
import { renderTable } from "templates/table"
|
2020-02-13 18:29:44 +01:00
|
|
|
import { setToggle } from "actions"
|
|
|
|
import {
|
|
|
|
Component,
|
2020-02-13 23:42:12 +01:00
|
|
|
mountHeader,
|
2020-02-13 18:29:44 +01:00
|
|
|
mountMain,
|
2020-02-13 18:50:39 +01:00
|
|
|
mountNavigation,
|
|
|
|
mountSearch,
|
2020-02-14 14:47:44 +01:00
|
|
|
mountTableOfContents,
|
2020-02-13 18:50:39 +01:00
|
|
|
useComponent,
|
|
|
|
watchComponentMap
|
2020-02-13 18:29:44 +01:00
|
|
|
} from "components2"
|
2020-02-14 14:47:44 +01:00
|
|
|
import { mountClipboard } from "./integrations/clipboard"
|
2020-02-14 15:00:56 +01:00
|
|
|
import { patchTables, patchDetails } from "patches"
|
2019-12-18 17:14:20 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Types
|
|
|
|
* ------------------------------------------------------------------------- */
|
|
|
|
|
2019-12-18 17:14:20 +01:00
|
|
|
/**
|
|
|
|
* Configuration
|
|
|
|
*/
|
|
|
|
export interface Config {
|
|
|
|
base: string /* Base URL */
|
|
|
|
worker: {
|
2019-12-22 17:30:55 +01:00
|
|
|
search: string /* Search worker URL */
|
|
|
|
packer: string /* Packer worker URL */
|
2019-12-18 17:14:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* TODO: where do we put this stuff?
|
|
|
|
* ------------------------------------------------------------------------- */
|
2019-12-18 17:14:20 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
document.documentElement.classList.remove("no-js")
|
|
|
|
document.documentElement.classList.add("js")
|
|
|
|
|
2020-02-12 19:13:03 +01:00
|
|
|
/* Test for iOS */
|
|
|
|
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g))
|
|
|
|
document.documentElement.classList.add("ios")
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
// add to config? default components to mount...?
|
2019-12-22 17:30:55 +01:00
|
|
|
const names: Component[] = [
|
|
|
|
"container", /* Container */
|
|
|
|
"header", /* Header */
|
|
|
|
"header-title", /* Header title */
|
|
|
|
"hero", /* Hero */
|
|
|
|
"main", /* Main area */
|
|
|
|
"navigation", /* Navigation */
|
|
|
|
"search", /* Search */
|
|
|
|
"search-query", /* Search input */
|
|
|
|
"search-reset", /* Search reset */
|
|
|
|
"search-result", /* Search results */
|
|
|
|
"tabs", /* Tabs */
|
|
|
|
"toc" /* Table of contents */
|
|
|
|
]
|
2019-12-18 17:14:20 +01:00
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
2019-12-22 17:30:55 +01:00
|
|
|
* Helper functions
|
2019-12-18 17:14:20 +01:00
|
|
|
* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ensure that the given value is a valid configuration
|
|
|
|
*
|
2019-12-22 17:30:55 +01:00
|
|
|
* We could use `jsonschema` or any other schema validation framework, but that
|
|
|
|
* would just add more bloat to the bundle, so we'll keep it plain and simple.
|
|
|
|
*
|
2019-12-18 17:14:20 +01:00
|
|
|
* @param config - Configuration
|
|
|
|
*
|
|
|
|
* @return Test result
|
|
|
|
*/
|
2019-12-22 17:30:55 +01:00
|
|
|
function isConfig(config: any): config is Config {
|
2019-12-18 17:14:20 +01:00
|
|
|
return typeof config === "object"
|
|
|
|
&& typeof config.base === "string"
|
2019-12-22 17:30:55 +01:00
|
|
|
&& typeof config.worker === "object"
|
|
|
|
&& typeof config.worker.search === "string"
|
|
|
|
&& typeof config.worker.packer === "string"
|
2019-12-18 17:14:20 +01:00
|
|
|
}
|
2019-09-29 00:30:56 +02:00
|
|
|
|
2019-12-24 17:59:26 +01:00
|
|
|
/**
|
|
|
|
* Yes, this is a super hacky implementation. Needs clean up.
|
|
|
|
*/
|
|
|
|
function repository() {
|
2020-02-02 16:19:01 +01:00
|
|
|
const el = getElement<HTMLAnchorElement>(".md-source[href]") // TODO: dont use classes
|
2019-12-24 17:59:26 +01:00
|
|
|
console.log(el)
|
|
|
|
if (!el)
|
|
|
|
return EMPTY
|
|
|
|
|
2020-01-08 18:17:19 +01:00
|
|
|
const data = sessionStorage.getItem("repository")
|
2019-12-24 17:59:26 +01:00
|
|
|
if (data) {
|
|
|
|
const x = JSON.parse(data)
|
|
|
|
return of(x)
|
|
|
|
}
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
// TODO: do correct rounding, see GitHub - done
|
2019-12-24 17:59:26 +01:00
|
|
|
function format(value: number) {
|
2020-02-13 18:29:44 +01:00
|
|
|
if (value > 999) {
|
|
|
|
const digits = +((value - 950) % 1000 > 99)
|
|
|
|
return `${(++value / 1000).toFixed(digits)}k`
|
|
|
|
} else {
|
|
|
|
return value.toString()
|
|
|
|
}
|
2019-12-24 17:59:26 +01:00
|
|
|
}
|
|
|
|
|
2020-01-08 18:17:19 +01:00
|
|
|
// github repository...
|
|
|
|
const [, user, repo] = el.href.match(/^.+github\.com\/([^\/]+)\/?([^\/]+)?.*$/i)
|
2019-12-24 17:59:26 +01:00
|
|
|
|
2020-02-12 19:13:03 +01:00
|
|
|
// storage memoization!?
|
|
|
|
// get, if not available, exec and persist
|
|
|
|
|
|
|
|
// getOrRetrieve... storage$.
|
|
|
|
|
2019-12-24 17:59:26 +01:00
|
|
|
// Show repo stats
|
|
|
|
if (user && repo) {
|
2020-02-12 19:13:03 +01:00
|
|
|
return fetchGitHubStats(user, repo)
|
2019-12-24 17:59:26 +01:00
|
|
|
.pipe(
|
2020-02-12 19:13:03 +01:00
|
|
|
map(({ stargazers_count, forks_count }) => ([
|
|
|
|
`${format(stargazers_count || 0)} Stars`,
|
|
|
|
`${format(forks_count || 0)} Forks`
|
|
|
|
])),
|
2020-01-08 18:17:19 +01:00
|
|
|
tap(data => sessionStorage.setItem("repository", JSON.stringify(data)))
|
2019-12-24 17:59:26 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// Show user or organization stats
|
|
|
|
} else if (user) {
|
2020-02-12 19:13:03 +01:00
|
|
|
return fetchGitHubStats(user)
|
2019-12-24 17:59:26 +01:00
|
|
|
.pipe(
|
2020-02-12 19:13:03 +01:00
|
|
|
map(({ public_repos }) => ([
|
|
|
|
`${format(public_repos || 0)} Repositories`
|
|
|
|
])),
|
2020-01-08 18:17:19 +01:00
|
|
|
tap(data => sessionStorage.setItem("repository", JSON.stringify(data)))
|
2019-12-24 17:59:26 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
return of([])
|
|
|
|
}
|
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Functions
|
|
|
|
* ------------------------------------------------------------------------- */
|
2019-12-20 18:03:31 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/**
|
|
|
|
* Initialize Material for MkDocs
|
|
|
|
*
|
|
|
|
* @param config - Configuration
|
|
|
|
*/
|
|
|
|
export function initialize(config: unknown) {
|
|
|
|
if (!isConfig(config))
|
|
|
|
throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`)
|
2019-12-20 18:03:31 +01:00
|
|
|
|
2020-02-12 19:13:03 +01:00
|
|
|
// pass config here!?
|
|
|
|
const document$ = watchDocument()
|
|
|
|
const hash$ = watchLocationHash()
|
2020-02-14 14:47:44 +01:00
|
|
|
const keyboard$ = watchKeyboard()
|
2020-02-12 19:13:03 +01:00
|
|
|
const viewport$ = watchViewport()
|
2020-02-13 18:50:39 +01:00
|
|
|
const tablet$ = watchMedia("(min-width: 960px)")
|
|
|
|
const screen$ = watchMedia("(min-width: 1220px)")
|
2020-02-12 19:13:03 +01:00
|
|
|
|
2019-11-26 17:56:45 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
2019-11-22 18:42:25 +01:00
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
watchComponentMap(names, { document$ })
|
|
|
|
watchToggleMap(["drawer", "search"], { document$ })
|
2019-11-27 19:12:49 +01:00
|
|
|
|
2019-11-26 17:56:45 +01:00
|
|
|
/* Create header observable */
|
2020-02-13 18:29:44 +01:00
|
|
|
const header$ = useComponent("header")
|
2019-12-20 18:03:31 +01:00
|
|
|
.pipe(
|
2020-02-13 23:42:12 +01:00
|
|
|
mountHeader()
|
2019-12-20 18:03:31 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const main$ = useComponent("main")
|
2019-12-20 18:03:31 +01:00
|
|
|
.pipe(
|
2020-02-13 18:50:39 +01:00
|
|
|
mountMain({ header$, viewport$ })
|
2019-12-20 18:03:31 +01:00
|
|
|
)
|
|
|
|
|
2020-02-12 19:13:03 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
const sw = setupSearchWorker(config.worker.search, {
|
2020-02-13 18:29:44 +01:00
|
|
|
base: config.base
|
2020-02-12 19:13:03 +01:00
|
|
|
})
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const search$ = useComponent("search")
|
2020-02-12 19:13:03 +01:00
|
|
|
.pipe(
|
2020-02-14 11:33:59 +01:00
|
|
|
mountSearch(sw, { viewport$, keyboard$ }),
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-12 19:13:03 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const navigation$ = useComponent("navigation")
|
2019-11-27 19:12:49 +01:00
|
|
|
.pipe(
|
2020-02-12 19:13:03 +01:00
|
|
|
mountNavigation({ main$, viewport$, screen$ })
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const toc$ = useComponent("toc")
|
2019-11-22 18:42:25 +01:00
|
|
|
.pipe(
|
2020-02-12 19:13:03 +01:00
|
|
|
mountTableOfContents({ header$, main$, viewport$, tablet$ })
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const tabs$ = useComponent("tabs")
|
2019-11-27 19:12:49 +01:00
|
|
|
.pipe(
|
2020-02-12 19:13:03 +01:00
|
|
|
mountTabs({ header$, viewport$, screen$ })
|
2019-12-22 17:30:55 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const hero$ = useComponent("hero")
|
2019-12-22 17:30:55 +01:00
|
|
|
.pipe(
|
2020-02-12 19:13:03 +01:00
|
|
|
mountHero({ header$, viewport$, screen$ })
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 23:42:12 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-14 15:00:56 +01:00
|
|
|
// TODO: general keyboard handler...
|
|
|
|
// put into main!?
|
|
|
|
|
2020-02-14 11:33:59 +01:00
|
|
|
// search$
|
|
|
|
// .pipe(
|
|
|
|
// filter(not),
|
|
|
|
// switchMapTo(keyboard$),
|
|
|
|
// filter(key => ["s", "f"].includes(key.type)),
|
|
|
|
// switchMapTo(toggle$)
|
|
|
|
// )
|
|
|
|
// .subscribe(toggle => {
|
|
|
|
// const el = getActiveElement()
|
|
|
|
// if (!(el && mayReceiveKeyboardEvents(el)))
|
|
|
|
// setToggle(toggle, true)
|
|
|
|
// })
|
2020-02-13 23:42:12 +01:00
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const search = getElement<HTMLInputElement>("[data-md-toggle=search]")!
|
2020-01-08 18:17:19 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
2019-12-20 18:03:31 +01:00
|
|
|
|
2020-02-14 14:47:44 +01:00
|
|
|
// patches... table, details, pre, ...
|
|
|
|
|
2020-01-08 18:17:19 +01:00
|
|
|
/* Open details before printing */
|
|
|
|
merge(
|
|
|
|
watchMedia("print").pipe(filter(identity)), // Webkit
|
2020-02-14 14:47:44 +01:00
|
|
|
fromEvent(window, "beforeprint") // IE, FF
|
2020-01-08 18:17:19 +01:00
|
|
|
)
|
|
|
|
.subscribe(() => {
|
2020-02-14 14:47:44 +01:00
|
|
|
for (const detail of getElements("details"))
|
2020-01-08 18:17:19 +01:00
|
|
|
detail.setAttribute("open", "")
|
|
|
|
})
|
|
|
|
|
2020-02-02 16:51:42 +01:00
|
|
|
// Close drawer and search on hash change
|
2020-02-12 19:13:03 +01:00
|
|
|
hash$.subscribe(() => {
|
2020-02-13 18:29:44 +01:00
|
|
|
|
|
|
|
useToggle("drawer").subscribe(el => {
|
|
|
|
setToggle(el, false)
|
|
|
|
})
|
|
|
|
|
|
|
|
useToggle("search").subscribe(el => { // omit nested subscribes...
|
|
|
|
setToggle(el, false)
|
|
|
|
})
|
2020-02-02 16:51:42 +01:00
|
|
|
})
|
|
|
|
|
2020-01-08 18:17:19 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-14 14:47:44 +01:00
|
|
|
// watchClipboard
|
2020-02-02 17:18:18 +01:00
|
|
|
|
2020-02-14 14:47:44 +01:00
|
|
|
mountClipboard({ document$ })
|
|
|
|
.subscribe(console.log)
|
2020-02-02 17:18:18 +01:00
|
|
|
|
2020-02-13 23:42:12 +01:00
|
|
|
// TODO: WIP repo rendering
|
|
|
|
repository().subscribe(facts => {
|
|
|
|
if (facts.length) {
|
|
|
|
const sources = getElements(".md-source__repository")
|
|
|
|
sources.forEach(repo => {
|
|
|
|
repo.dataset.mdState = "done"
|
|
|
|
repo.appendChild(
|
|
|
|
renderSource(facts)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2020-02-14 14:47:44 +01:00
|
|
|
// TODO: this is just a re-rendering patch...
|
2020-02-14 15:00:56 +01:00
|
|
|
patchTables({ document$ })
|
|
|
|
.subscribe(console.log)
|
|
|
|
|
|
|
|
patchDetails({ document$ })
|
|
|
|
.subscribe(console.log)
|
2020-02-14 14:47:44 +01:00
|
|
|
|
|
|
|
// /* Wrap all data tables for better overflow scrolling */
|
|
|
|
// const placeholder = document.createElement("table")
|
|
|
|
// for (const table of getElements<HTMLTableElement>("table:not([class])")) {
|
|
|
|
// table.replaceWith(placeholder)
|
|
|
|
// placeholder.replaceWith(renderTable(table))
|
|
|
|
// }
|
2020-02-12 19:13:03 +01:00
|
|
|
|
2020-02-14 14:47:44 +01:00
|
|
|
// accidentally triggers on resize
|
2020-02-12 19:13:03 +01:00
|
|
|
let lastOffset = 0
|
|
|
|
tablet$.pipe(
|
|
|
|
switchMap(active => {
|
|
|
|
return !active ? watchToggle(search) : EMPTY
|
|
|
|
}),
|
|
|
|
switchMap(toggle => {
|
|
|
|
if (toggle) {
|
|
|
|
console.log("ACTIVE")
|
|
|
|
return of(document.body)
|
|
|
|
.pipe(
|
|
|
|
tap(() => lastOffset = window.pageYOffset),
|
|
|
|
delay(400),
|
|
|
|
tap(() => {
|
|
|
|
window.scrollTo(0, 0),
|
|
|
|
console.log("scrolled... to top, locked body")
|
|
|
|
document.body.dataset.mdState = "lock"
|
|
|
|
})
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
console.log("INACTIVE")
|
|
|
|
return of(document.body)
|
|
|
|
.pipe(
|
|
|
|
tap(() => document.body.dataset.mdState = ""),
|
|
|
|
delay(100),
|
|
|
|
tap(() => {
|
|
|
|
window.scrollTo(0, lastOffset)
|
|
|
|
})
|
|
|
|
)
|
|
|
|
}
|
|
|
|
return EMPTY
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe(x => console.log("SEARCHLOCK", x))
|
|
|
|
|
2020-02-02 17:18:18 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
const state = {
|
2020-02-13 18:29:44 +01:00
|
|
|
search$,
|
2019-12-22 17:30:55 +01:00
|
|
|
main$,
|
|
|
|
navigation$,
|
|
|
|
toc$,
|
|
|
|
tabs$,
|
|
|
|
hero$
|
2019-12-20 18:03:31 +01:00
|
|
|
}
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const { ...rest } = state
|
|
|
|
merge(...values(rest))
|
2019-12-22 17:30:55 +01:00
|
|
|
.subscribe() // potential memleak <-- use takeUntil
|
2019-11-27 19:12:49 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
return {
|
2020-02-12 19:13:03 +01:00
|
|
|
// agent,
|
2019-12-22 17:30:55 +01:00
|
|
|
state
|
2019-11-26 17:56:45 +01:00
|
|
|
}
|
2019-09-29 00:30:56 +02:00
|
|
|
}
|