<commit_before>import * as React from 'react'
import {BehaviorSubject, Subscription, Observable} from 'rxjs'
import 'rxjs/add/operator/distinctUntilChanged'
import 'rxjs/add/operator/switchMap'
import {shallowEqual} from './shallowEqual'

export interface PropsMapper<EP, IP> {
   (externalProps: EP): Observable<IP>
}

export interface ConnectedComponent<EP> {
   new(props: EP): React.Component<EP, {}>
}

export interface Spinner extends React.StatelessComponent<{}> {
}

const defaultSpinner: Spinner = () => <span />

function wrapper<EP, IP, WC>(propsMapper: PropsMapper<EP, IP>,
                             wrappedComponent: React.StatelessComponent<IP>,
                             spinner: Spinner = defaultSpinner): ConnectedComponent<EP> {

   return class extends React.Component<EP, {}> {
      private externalProps$: BehaviorSubject<EP>
      private subscription: Subscription
      private internalProps: IP

      componentWillMount() {
         this.externalProps$ = new BehaviorSubject(this.props)
         const internalProps$: Observable<IP> = this.externalProps$
            .distinctUntilChanged(shallowEqual)<commit_msg>Add className to default spinner<commit_after>import * as React from 'react'
import {BehaviorSubject, Subscription, Observable} from 'rxjs'
import 'rxjs/add/operator/distinctUntilChanged'
import 'rxjs/add/operator/switchMap'
import {shallowEqual} from './shallowEqual'

export interface PropsMapper<EP, IP> {
   (externalProps: EP): Observable<IP>
}

export interface ConnectedComponent<EP> {
   new(props: EP): React.Component<EP, {}>
}

export interface Spinner extends React.StatelessComponent<{}> {
}

const defaultSpinner: Spinner = () => <div className="react-rx-pure-connect-spinner"/>

function wrapper<EP, IP, WC>(propsMapper: PropsMapper<EP, IP>,
                             wrappedComponent: React.StatelessComponent<IP>,
                             spinner: Spinner = defaultSpinner): ConnectedComponent<EP> {

   return class extends React.Component<EP, {}> {
      private externalProps$: BehaviorSubject<EP>
      private subscription: Subscription
      private internalProps: IP

      componentWillMount() {
         this.externalProps$ = new BehaviorSubject(this.props)
         const internalProps$: Observable<IP> = this.externalProps$
            .distinctUntilChanged(shallowEqual)
{'fraction_non_alphanumeric': 0.10752231194220145, 'fraction_numerical': 0.0, 'mean_word_length': 3.8536082474226805, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, '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': '5724479', 'n_tokens_mistral': 643, 'n_tokens_neox': 634, 'n_words': 154}