bigpipe-util 0.2.13 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/core/$.js DELETED
@@ -1,3 +0,0 @@
1
- export default function (elementId) {
2
- return document.getElementById(elementId);
3
- }
@@ -1,38 +0,0 @@
1
- import CSSCore from "fbjs/lib/CSSCore";
2
-
3
- export function byTag(node, tagName) {
4
- tagName = tagName.toUpperCase();
5
- node = find(node, function (el) {
6
- return el.nodeName === tagName;
7
- });
8
-
9
- return node instanceof Element ? node : null;
10
- }
11
-
12
- export function byClass(node, className) {
13
- node = find(node, function (el) {
14
- return el instanceof Element && CSSCore.hasClass(el, className);
15
- });
16
-
17
- return node instanceof Element ? node : null;
18
- }
19
-
20
- export function byAttribute(node, attribute) {
21
- node = find(node, function (el) {
22
- return el instanceof Element && el.hasAttribute(attribute);
23
- });
24
-
25
- return node instanceof Element ? node : null;
26
- }
27
-
28
- export function find(node, callback) {
29
- while (node) {
30
- if (callback(node)) {
31
- return node;
32
- }
33
-
34
- node = node.parentNode;
35
- }
36
-
37
- return null;
38
- }
@@ -1,9 +0,0 @@
1
- export default class ReloadPage {
2
- now() {
3
- window.location.reload();
4
- }
5
-
6
- delay(delay) {
7
- setTimeout(this.now.bind(this), delay);
8
- }
9
- }
@@ -1,7 +0,0 @@
1
- export default class ServerRedirect {
2
- redirectPageTo(url, delay = 0) {
3
- setTimeout(function () {
4
- window.location = url;
5
- }, delay);
6
- }
7
- }
@@ -1,13 +0,0 @@
1
- import EventListener from 'fbjs/lib/EventListener';
2
-
3
- export default function onAfterLoad(callback) {
4
- if (document.readyState === 'complete') {
5
- setTimeout(callback, 0);
6
- } else {
7
- const event = EventListener.capture(window, 'load', () => {
8
- event.remove();
9
-
10
- callback();
11
- });
12
- }
13
- }