本文整理汇总了TypeScript中@cycle/base.StreamAdapter.remember方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StreamAdapter.remember方法的具体用法?TypeScript StreamAdapter.remember怎么用?TypeScript StreamAdapter.remember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@cycle/base.StreamAdapter
的用法示例。
在下文中一共展示了StreamAdapter.remember方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: path
path(pathname: Pathname): RouterSource {
const scopedNamespace = this._namespace.concat(util.splitPath(pathname));
const scopedHistory$ = this._runSA.remember(this._history$
.filter(({pathname: _path}: Location) => isStrictlyInScope(scopedNamespace, _path)));
const createHref = this._createHref;
return new RouterSource(scopedHistory$, scopedNamespace, createHref, this._runSA);
}
示例2: define
define(routes: RouteDefinitions): any {
const namespace = this._namespace;
const _createHref = this._createHref;
const createHref = util.makeCreateHref(namespace, _createHref);
let match$ = this._runSA.remember(this._history$
.map((location: Location) => {
const filteredPath = getFilteredPath(namespace, location.pathname);
const {path, value} = switchPath(filteredPath, routes);
return {path, value, location, createHref};
}));
match$.createHref = createHref;
return match$;
}
示例3: routerDriver
return function routerDriver(sink$: any, runSA: StreamAdapter) {
const history$ = runSA.remember(historyDriver(sink$, runSA));
return new RouterSource(history$, [], history.createHref, runSA);
};
示例4:
get history$() {
return this._runSA.remember(this._history$);
}