@openctx/client
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -60,2 +60,7 @@ import type { AnnotationsParams, ItemsParams, ItemsResult, MentionsParams, MentionsResult, MetaParams, MetaResult } from '@openctx/protocol'; | ||
/** | ||
* If set will load in the OpenCtx providers after the delay. If not set, | ||
* providers are lazily loaded. | ||
*/ | ||
preloadDelay?: number; | ||
/** | ||
* @internal | ||
@@ -62,0 +67,0 @@ */ |
import { LRUCache } from 'lru-cache'; | ||
import { catchError, combineLatest, distinctUntilChanged, firstValueFrom, from, map, mergeMap, of, shareReplay, } from 'rxjs'; | ||
import { catchError, combineLatest, concatMap, distinctUntilChanged, firstValueFrom, from, map, mergeMap, of, shareReplay, take, timer, } from 'rxjs'; | ||
import { observeAnnotations, observeItems, observeMentions, observeMeta, } from '../api.js'; | ||
@@ -85,2 +85,8 @@ import { configurationFromUserInput, } from '../configuration.js'; | ||
}; | ||
if (env.preloadDelay !== undefined) { | ||
const preload = timer(env.preloadDelay) | ||
.pipe(concatMap(() => providerClientsWithSettings(undefined))) | ||
.pipe(take(1)); | ||
subscriptions.push(preload.subscribe()); | ||
} | ||
return { | ||
@@ -87,0 +93,0 @@ meta: (params, opts) => firstValueFrom(metaChanges(params, { ...opts, emitPartial: false }), { |
{ | ||
"name": "@openctx/client", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "OpenCtx client library", | ||
@@ -25,3 +25,3 @@ "license": "Apache-2.0", | ||
"rxjs": "^7.8.1", | ||
"@openctx/protocol": "0.0.13", | ||
"@openctx/protocol": "0.0.14", | ||
"@openctx/provider": "0.0.13", | ||
@@ -28,0 +28,0 @@ "@openctx/schema": "0.0.11" |
@@ -19,2 +19,3 @@ import type { | ||
combineLatest, | ||
concatMap, | ||
distinctUntilChanged, | ||
@@ -27,2 +28,4 @@ firstValueFrom, | ||
shareReplay, | ||
take, | ||
timer, | ||
} from 'rxjs' | ||
@@ -105,2 +108,8 @@ import { | ||
/** | ||
* If set will load in the OpenCtx providers after the delay. If not set, | ||
* providers are lazily loaded. | ||
*/ | ||
preloadDelay?: number | ||
/** | ||
* @internal | ||
@@ -391,2 +400,9 @@ */ | ||
if (env.preloadDelay !== undefined) { | ||
const preload = timer(env.preloadDelay) | ||
.pipe(concatMap(() => providerClientsWithSettings(undefined))) | ||
.pipe(take(1)) | ||
subscriptions.push(preload.subscribe()) | ||
} | ||
return { | ||
@@ -393,0 +409,0 @@ meta: (params, opts) => |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126599
1994
+ Added@openctx/protocol@0.0.14(transitive)
Updated@openctx/protocol@0.0.14