consul/ui-v2/app/utils/dom
John Cowen 01d1b3c139 ui: Small EventSource additions (#5978)
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)
);

```
2019-09-04 08:35:05 +00:00
..
event-source ui: Small EventSource additions (#5978) 2019-09-04 08:35:05 +00:00
event-target UI: Add EventSource ready for implementing blocking queries (#5070) 2019-05-01 18:22:06 +00:00
click-first-anchor.js ui: Allow text selection of clickable elements and their contents (#5770) 2019-09-04 08:34:58 +00:00
closest.js UI: New ACLs (#4789) 2018-10-19 08:45:05 -07:00
create-listeners.js ui: Enable creating listeners using an object/hash (#5975) 2019-09-04 08:35:04 +00:00
get-component-factory.js UI: dom usage refactoring (#4924) 2019-05-01 18:21:40 +00:00
normalize-event.js UI: New ACLs (#4789) 2018-10-19 08:45:05 -07:00
qsa-factory.js UI: New ACLs (#4789) 2018-10-19 08:45:05 -07:00
sibling.js UI: New ACLs (#4789) 2018-10-19 08:45:05 -07:00