mirror of https://github.com/hashicorp/consul
01d1b3c139
1. EventSources now pass themselves thorugh to the run function as a second argument. This enables the use of arrow functions along with the EventSources API `(configuration, source) => source.close()`. Order of arguments could potentially be switched at a later date. 2. BlockingEventSources now let you pass an 'event' through at instantation time. If you do this, the event will immediately be dispatched once the EventSource is opened. The usecase for this is for 'unfreezing' cached BlockingEvents. This makes it easier to provide a cache for BlockingEventSources by caching its data rather than the entire BlockingEventSource itself. ``` new BlockingEventSource( (config, source) => { /* something */ }, { cursor: 1024, // this would also come from a cache currentEvent: getFromSomeSortOfCache(eventSourceId) //this is the new bit } ); // more realistically new BlockingEventSource( (config, source) => { return data.findSomething(slug, config) }, getFromSomeSortOfCache(eventSourceId) ); ``` |
||
---|---|---|
.. | ||
computed | ||
dom | ||
editor | ||
form | ||
helpers | ||
http | ||
model | ||
routing | ||
search | ||
storage | ||
acls-status.js | ||
ascend.js | ||
atob.js | ||
btoa.js | ||
callable-type.js | ||
confirm.js | ||
createURL.js | ||
distance.js | ||
error.js | ||
get-form-name-property.js | ||
get-object-pool.js | ||
hasStatus.js | ||
injectableRequestToJQueryAjaxHash.js | ||
isFolder.js | ||
keyToArray.js | ||
left-trim.js | ||
makeAttrable.js | ||
minimizeModel.js | ||
promisedTimeout.js | ||
remove-null.js | ||
right-trim.js | ||
sumOfUnhealthy.js | ||
templatize.js | ||
tomography.js | ||
ucfirst.js | ||
update-array-object.js |