Buckets:

immErfanrajabee/bd / node_modules /@lit /context /development /lib /context-request-event.js
imerfanrajabee's picture
download
raw
1.63 kB
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* An event fired by a context requester to signal it desires a specified context with the given key.
*
* A provider should inspect the `context` property of the event to determine if it has a value that can
* satisfy the request, calling the `callback` with the requested value if so.
*
* If the requested context event contains a truthy `subscribe` value, then a provider can call the callback
* multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`
* method to the callback which consumers can invoke to indicate they no longer wish to receive these updates.
*
* If no `subscribe` value is present in the event, then the provider can assume that this is a 'one time'
* request for the context and can therefore not track the consumer.
*/
export class ContextRequestEvent extends Event {
/**
*
* @param context the context key to request
* @param contextTarget the original context target of the requester
* @param callback the callback that should be invoked when the context with the specified key is available
* @param subscribe when, true indicates we want to subscribe to future updates
*/
constructor(context, contextTarget, callback, subscribe) {
super('context-request', { bubbles: true, composed: true });
this.context = context;
this.contextTarget = contextTarget;
this.callback = callback;
this.subscribe = subscribe ?? false;
}
}
//# sourceMappingURL=context-request-event.js.map

Xet Storage Details

Size:
1.63 kB
·
Xet hash:
867ffd659a9441e0cf5be12efb40ecaecd38d817c269ff4f5eb57b993dfaa0f9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.