<commit_before>'use strict';

var StopsListView = require( './view' );

var TripsCollection = require( '../../collections/trips' );

var lines = require( '../../data' ).lines;

function lineOverviewRoute( lineSlug ) {

  var line = lines.bySlug( lineSlug );

  var trips = new TripsCollection([], {
    line: lineSlug
  });

  new StopsListView({
    model: line,
    collection: trips
  });

  // Kick off trips data request
  trips.fetch();

}

module.exports = lineOverviewRoute;<commit_msg>Cache trips predictions collections in data module<commit_after>'use strict';

var StopsListView = require( './view' );

var TripsCollection = require( '../../collections/trips' );

var data = require( '../../data' );

function lineOverviewRoute( lineSlug ) {

  var line = data.lines.bySlug( lineSlug );

  var trips = data.predictions.get( lineSlug );
  if ( ! trips ) {
    trips = new TripsCollection([], {
      line: lineSlug
    });
    data.predictions.set( lineSlug, trips );
  }

  new StopsListView({
    model: line,
    collection: trips
  });

  // Kick off trips data request
  trips.fetch();

}

module.exports = lineOverviewRoute;
{'fraction_non_alphanumeric': 0.1481156879929886, 'fraction_numerical': 0.0, 'mean_word_length': 3.2140221402214024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4308046', 'n_tokens_mistral': 368, 'n_tokens_neox': 355, 'n_words': 96}