How to use the tiny-emitter/instance.emit function in tiny-emitter

To help you get started, we’ve selected a few tiny-emitter 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 syousif94 / frugalmaps / frugalapp / src / TabBar.js View on Github external
InteractionManager.runAfterInteractions(() => {
        emitter.emit("reclip-calendar");
      });
    });
github syousif94 / frugalmaps / buncha / screens / UpNextScreen.js View on Github external
const dismissFilters = () => {
      emitter.emit("filters");
    };
    const onEvent = () => {
github syousif94 / frugalmaps / buncha / store / events.js View on Github external
return (dispatch, getState) => {
    const {
      filters: { day, time, notNow },
      events: { calendar, bounds }
    } = getState();

    emitter.emit("filters");

    if (!time.trim().length) {
      dispatch({
        type: "events/set",
        payload: {
          notNow,
          day,
          upNext: calendar.find(events => events.iso === day.iso).data
        }
      });
    } else {
      const expandedTime = detruncateTime(time);
      const searchTime = moment(`${day.title} ${expandedTime}`, "dddd h:mma");
      if (searchTime.isBefore(moment(), "minute")) {
        searchTime.add("7", "d");
      }
github syousif94 / frugalmaps / frugalapp / src / LocationSuggestion.js View on Github external
_onPressIn = () => {
    const { item, type } = this.props;

    let bounds;

    if (type !== "Search") {
      bounds = item._source.bounds;
    } else {
      bounds = item.geometry.viewport;
    }

    this._resetOnRelease = true;
    emitter.emit("preview-bounds", bounds);
  };
github lvlrSajjad / react-native-blur-overlay / index.js View on Github external
export function closeOverlay() {
    emitter.emit('drawer-close');
}
github syousif94 / frugalmaps / buncha / components / InterestedModal.js View on Github external
onPress={() => {
                    emitter.emit("blur-interested");
                    dispatch({
                      type: "interested/set",
                      payload: {
                        event: null
                      }
                    });
                  }}
                  style={styles.button}
github syousif94 / frugalmaps / frugalapp / src / LocationSuggestion.js View on Github external
text = item.formatted_address;
    }

    setEvents({
      refreshing: true,
      bounds,
      queryType: "City"
    });

    setLocation({
      lastQuery: text,
      text,
      bounds: null
    });

    emitter.emit("blur-location-box", this.props.id);
    emitter.emit("fit-bounds", bounds);
  };
github syousif94 / frugalmaps / buncha / components / ProfileView.js View on Github external
onPress={() => {
            dispatch(User.saveProfile());
            dispatch({
              type: "user/set",
              payload: {
                showContacts: true
              }
            });
            emitter.emit("scroll-intro-contacts");
          }}
        />
github syousif94 / frugalmaps / frugalapp / src / LocationBox.js View on Github external
_onChangeText = text => {
    const showCompletions = text.length > this.props.text.length;
    this.props.set({
      text
    });
    if (showCompletions) {
      emitter.emit("show-completions");
    }
  };
github syousif94 / frugalmaps / buncha / components / MapMarker.js View on Github external
_onSelect = () => {
    if (ANDROID) {
      emitter.emit("deselect-marker");
      emitter.on("deselect-marker", this._onDeselect);
    }
    this.setState({
      selected: true
    });
    this.props.selectEvent(this.props.data._id);
  };

tiny-emitter

A tiny (less than 1k) event emitter library

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis