How to use the hyperview/src/services/behaviors.setIndicatorsBeforeLoad function in hyperview

To help you get started, we’ve selected a few hyperview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Instawork / hyperview / src / behaviors / hv-show / index.js View on Github external
showIndicatorIds,
          hideIndicatorIds,
          newRoot,
        );
      }
      // Update the DOM with the new shown state and finished indicators.
      updateRoot(newRoot);
    };

    if (delay === 0) {
      // If there's no delay, show target immediately without showing/hiding
      // any indicators.
      showElement();
    } else {
      // If there's a delay, first trigger the indicators before the show.
      const newRoot = Behaviors.setIndicatorsBeforeLoad(
        showIndicatorIds,
        hideIndicatorIds,
        getRoot(),
      );
      // Update the DOM to reflect the new state of the indicators.
      updateRoot(newRoot);
      // Wait for the delay then show the target.
      later(delay)
        .then(showElement)
        .catch(showElement);
    }
  },
};
github Instawork / hyperview / src / behaviors / hv-toggle / index.js View on Github external
showIndicatorIds,
          hideIndicatorIds,
          newRoot,
        );
      }
      // Update the DOM with the new toggle state and finished indicators.
      updateRoot(newRoot);
    };

    if (delay === 0) {
      // If there's no delay, toggle immediately without showing/hiding
      // any indicators.
      toggleElement();
    } else {
      // If there's a delay, first trigger the indicators before the toggle.
      const newRoot = Behaviors.setIndicatorsBeforeLoad(
        showIndicatorIds,
        hideIndicatorIds,
        getRoot(),
      );
      // Update the DOM to reflect the new state of the indicators.
      updateRoot(newRoot);
      // Wait for the delay then toggle the target.
      later(delay)
        .then(toggleElement)
        .catch(toggleElement);
    }
  },
};
github Instawork / hyperview / src / behaviors / hv-hide / index.js View on Github external
showIndicatorIds,
          hideIndicatorIds,
          newRoot,
        );
      }
      // Update the DOM with the new hidden state and finished indicators.
      updateRoot(newRoot);
    };

    if (delay === 0) {
      // If there's no delay, hide target immediately without showing/hiding
      // any indicators.
      hideElement();
    } else {
      // If there's a delay, first trigger the indicators before the hide
      const newRoot = Behaviors.setIndicatorsBeforeLoad(
        showIndicatorIds,
        hideIndicatorIds,
        getRoot(),
      );
      // Update the DOM to reflect the new state of the indicators.
      updateRoot(newRoot);
      // Wait for the delay then hide the target.
      later(delay)
        .then(hideElement)
        .catch(hideElement);
    }
  },
};