本文整理匯總了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$);
}