How to use the subscribe-ui-event.listen function in subscribe-ui-event

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

github yahoo / react-i13n / src / libs / ComponentSpecs.js View on Github external
componentDidMount() {
    const self = this;
    const reactI13n = self._getReactI13n();
    if (!reactI13n) {
      return;
    }

    // bind the click event for i13n component if it's enabled
    if (self.props.bindClickEvent) {
      self.clickEventListener = listen(ReactDOM.findDOMNode(self), 'click', clickHandler.bind(self));
    }

    const domNode = ReactDOM.findDOMNode(self);
    self._i13nNode.setDOMNode(domNode);

    // enable viewport checking if enabled
    if (reactI13n.isViewportEnabled()) {
      self._viewportDetector = new ViewportDetector(domNode, self._getViewportOptions(), () => {
        self._handleEnterViewport();
      });
      if (pageInitViewportDetected) {
        self._viewportDetector.init();
      } else {
        self._triggerPageInitViewportDetection();
      }
    }
github yahoo / react-i13n / src / libs / ComponentSpecs.js View on Github external
i13nNode.setDOMNode(element);
      const subThis = {
        props: {
          href: element.href,
          follow: true
        },
        getI13nNode: function getI13nNodeForScannedNode() {
          return i13nNode;
        }
      };

      subThis._shouldFollowLink = self._shouldFollowLink.bind(subThis);
      subThis.executeI13nEvent = self.executeI13nEvent.bind(self);

      self._subI13nComponents.push({
        componentClickListener: listen(element, 'click', clickHandler.bind(subThis)),
        debugDashboard: IS_DEBUG_MODE ? new DebugDashboard(i13nNode) : null,
        domElement: element,
        i13nNode
      });
      self._getReactI13n().execute('created', { i13nNode });
    });
  },

subscribe-ui-event

A single, throttle built-in solution to subscribe to browser UI Events.

Unrecognized
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis

Popular subscribe-ui-event functions

Similar packages