<commit_before>import React from 'react';
import {connect} from 'react-redux';
import values from 'lodash/values';
import flatten from 'lodash/flatten';
import isEmpty from 'lodash/isEmpty';
import bindAll from 'lodash/bindAll';
import i18n from 'i18next-client';

import {
  addRuntimeError,
  changeCurrentProject,
  clearRuntimeErrors,
  createProject,
  loadAllProjects,
  loadCurrentProjectFromStorage,
  updateProjectSource,
  toggleLibrary,
  listenForAuth,
} from '../actions';

import Editor from './Editor';
import Output from './Output';
import Toolbar from './Toolbar';

function mapStateToProps(state) {
  const currentProject = state.projects.get(
    state.currentProject.get('projectKey')
  );

  let currentProjectJS;
  if (currentProject) {
    currentProjectJS = currentProject.toJS();
  }

  return {
    allProjects: values(state.projects.toJS()),
    currentProject: currentProjectJS,
    errors: state.errors.toJS(),
    runtimeErrors: state.runtimeErrors.toJS(),
    delayErrorDisplay: state.delayErrorDisplay,
    currentUser: state.user.toJS(),
  };
}

class Workspace extends React.Component {
  constructor() {
    super();
    bindAll(this, '_confirmUnload');
  }

  componentWillMount() {
    this.props.dispatch(listenForAuth());
    this.props.dispatch(loadCurrentProjectFromStorage());
    this.props.dispatch(loadAllProjects());
  }<commit_msg>Remove explicit calls to load data in Workspace<commit_after>import React from 'react';
import {connect} from 'react-redux';
import values from 'lodash/values';
import flatten from 'lodash/flatten';
import isEmpty from 'lodash/isEmpty';
import bindAll from 'lodash/bindAll';
import i18n from 'i18next-client';

import {
  addRuntimeError,
  changeCurrentProject,
  clearRuntimeErrors,
  createProject,
  loadAllProjects,
  loadCurrentProjectFromStorage,
  updateProjectSource,
  toggleLibrary,
  listenForAuth,
} from '../actions';

import Editor from './Editor';
import Output from './Output';
import Toolbar from './Toolbar';

function mapStateToProps(state) {
  const currentProject = state.projects.get(
    state.currentProject.get('projectKey')
  );

  let currentProjectJS;
  if (currentProject) {
    currentProjectJS = currentProject.toJS();
  }

  return {
    allProjects: values(state.projects.toJS()),
    currentProject: currentProjectJS,
    errors: state.errors.toJS(),
    runtimeErrors: state.runtimeErrors.toJS(),
    delayErrorDisplay: state.delayErrorDisplay,
    currentUser: state.user.toJS(),
  };
}

class Workspace extends React.Component {
  constructor() {
    super();
    bindAll(this, '_confirmUnload');
  }

  componentWillMount() {
    this.props.dispatch(listenForAuth());
  }
{'fraction_non_alphanumeric': 0.11681547619047619, 'fraction_numerical': 0.002976190476190476, 'mean_word_length': 4.697033898305085, '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': '1181356', 'n_tokens_mistral': 808, 'n_tokens_neox': 790, 'n_words': 183}