How to use the oboe function in oboe

To help you get started, we’ve selected a few oboe 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 vladimiry / ElectronMail / src / electron-main / database / serialization.ts View on Github external
return new Promise((resolve, reject) => {
                this.logger.verbose(`"oboe" start`);

                // TODO replace "oboe" with alternative library that doesn't block the Event Loop so heavily
                //      review the following libraries:
                //      - https://gitlab.com/philbooth/bfj
                //      - https://github.com/ibmruntimes/yieldable-json
                //      or consider moving parsing to a separate Worker/Process
                oboe(readableStream)
                    .done((parsed) => {
                        this.logger.verbose(`"oboe" end`);
                        resolve(parsed);
                    })
                    .fail((error) => {
                        this.logger.error(`"oboe" fail`, error);
                        reject(error);
                    });
            });
        };
github nusmodifications / nusmods / scrapers / nus-v2 / src / services / nus-api.ts View on Github external
new Promise((resolve, reject) => {
      const endpoint = 'classtt/withdate/published';
      const url = new URL(endpoint, config.baseUrl);
      const body = JSON.stringify({ term });

      oboe({
        url: url.href,
        headers,
        body,
        method: 'POST',
      })
        .node('data[*]', (lesson: TimetableLesson) => {
          // Consume and discard each lesson
          lessonConsumer(lesson);
          return oboe.drop;
        })
        .done((data) => {
          // Handle application level errors
          const { code, msg } = data;

          if (code === OKAY) {
            resolve();
github FH-Potsdam / shifted-maps / app / client / actions / storyline.js View on Github external
let debounceDispatch = debounce(dispatch, 5);

    function sendStoryline() {
      return function(dispatch) {
        dispatch(addPlaces(places));
        dispatch(addStays(stays));
        dispatch(addTrips(trips));

        // Reset data arrays
        places = [];
        stays = [];
        trips = [];
      }
    }

    oboe('/api')
      .node('startAt', function(startAt) {
        return new Date(startAt * 1000);
      })
      .node('endAt', function(endAt) {
        return new Date(endAt * 1000);
      })
      .node('location', function(location) {
        return L.latLng(location.lat, location.lon);
      })
      .node('place', function(place) {
        place = new Place(place);
        places.push(place);

        debounceDispatch(sendStoryline());

        return oboe.drop;
github Flexget / webui / src / core / api / index.ts View on Github external
useEffect(() => {
    if (readyState === ReadyState.Connecting) {
      stream.current?.abort();
      clear();
      stream.current = oboe({
        url: `${baseURI.current.pathname}api${url}`,
        method: Method.Get,
      })
        .start(() => setReadyState(ReadyState.Open))
        .node('{message task}', (message: Message) => addMessage(camelize(message)))
        .fail(() => setReadyState(ReadyState.Closed));
    }
  }, [clear, readyState, url]);
github tsuru / tsuru-dashboard / tsuru_dashboard / static / js / src / components / log.js View on Github external
componentDidMount() {
    oboe(this.state.url).done((things) => {
      this.setState({logging: true});

      $.each(things, (i, data) => {
        var msg = "<p><strong>" + data.Date + " [ " + data.Source + " ][ " + data.Unit + " ]:</strong> - " + data.Message + "</p>";
        $(".log").append("<p>" + msg + "</p>");
      });

      if (this.state.follow) {
        this.follow();
      }
    });
  }
github cinedantan / cinedantan / src / actions / app.js View on Github external
const fetchMoviesStream = () => {
    return oboe(MOVIES_JSON_URL)
}

oboe

Oboe.js reads json, giving you the objects as they are found without waiting for the stream to finish

BSD
Latest version published 6 years ago

Package Health Score

64 / 100
Full package analysis

Popular oboe functions