<commit_before>﻿import React from 'react';
import PlayerHeader from './components/Header.react';
import PlayerControls from './components/Controls.react';
import PlayerRender from './components/Renderer.react';

import PlayerStore from './store';
import PlayerActions from './actions';

let If = React.createClass({
    render() {
        return this.props.test ? this.props.children : false;
    }
});

export
default React.createClass({
    getInitialState() {
        return {
            data: PlayerStore.getState().data,
            type: PlayerStore.getState().type,
            uri: PlayerStore.getState().uri
        }
    },
    componentDidMount() {
        PlayerStore.listen(this.update);
    },
    componentWillUnmount() {
        PlayerStore.unlisten(this.update);
    },
    update() {
        if (this.isMounted()) {
            this.setState({
                data: PlayerStore.getState().data,
                type: PlayerStore.getState().type,
                uri: PlayerStore.getState().uri
            });
        }
    },
    render() {
        console.log(this.state.uri);
        return (
            <div className="wcjs-player" >
                <PlayerHeader title="PlaceHolder Title"/>
                <If test={this.state.uri}>
                    <PlayerRender uri={this.state.uri}/>
                    <PlayerControls />
                </If>
            </div>
        );
    }
});<commit_msg>change to willMount<commit_after>﻿import React from 'react';
import PlayerHeader from './components/Header.react';
import PlayerControls from './components/Controls.react';
import PlayerRender from './components/Renderer.react';

import PlayerStore from './store';
import PlayerActions from './actions';

let If = React.createClass({
    render() {
        return this.props.test ? this.props.children : false;
    }
});

export
default React.createClass({
    getInitialState() {
        return {
            data: PlayerStore.getState().data,
            type: PlayerStore.getState().type,
            uri: PlayerStore.getState().uri
        }
    },
    componentWillMount() {
        PlayerStore.listen(this.update);
    },
    componentWillUnmount() {
        PlayerStore.unlisten(this.update);
    },
    update() {
        this.setState({
            data: PlayerStore.getState().data,
            type: PlayerStore.getState().type,
            uri: PlayerStore.getState().uri
        });
    },
    render() {
        console.log(this.state.uri);
        return (
            <div className="wcjs-player" >
                <PlayerHeader title="PlaceHolder Title"/>
                <If test={this.state.uri}>
                    <PlayerRender uri={this.state.uri}/>
                    <PlayerControls />
                </If>
            </div>
        );
    }
});
{'fraction_non_alphanumeric': 0.13316672616922529, 'fraction_numerical': 0.0, 'mean_word_length': 1.9066390041493777, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '793678', 'n_tokens_mistral': 745, 'n_tokens_neox': 733, 'n_words': 144}