<commit_before>import * as React from 'react';
import { Iterable } from 'ix';
import { Observable, Subscription } from 'rxjs';
import { AnonymousSubscription, TeardownLogic } from 'rxjs/Subscription';

import { IterableLike, Property, Command } from '../../WebRx';
import { ReactSpreadResult, ReactSpreadRestrictedProps, reactRestrictedProps } from '../../Extensions/React';
import { Alert, Logging } from '../../Utils';
import { ViewModelLifecyle } from './Interfaces';
import { BaseViewModel, isViewModelLifecycle } from './BaseViewModel';
import { renderIterable, renderConditional, renderNullable, renderLoadable, renderSizedLoadable, renderGridLoadable, focusElement, classNames } from './RenderHelpers';
import { bindObservableToCommand, bindEventToProperty, bindEventToCommand } from './BindingHelpers';

export interface ViewModelProps<T extends BaseViewModel> {
  viewModel: Readonly<T>;
}

export type ReactSpreadRestrictedViewModelProps = ReactSpreadRestrictedProps & Partial<ViewModelProps<any>>;

export const reactSpreadRestrictedViewModelProps: ReactSpreadRestrictedViewModelProps = Object.assign(
  { viewModel: undefined },
  reactRestrictedProps,
);

export interface BaseViewProps<TViewModel extends BaseViewModel, TView> extends ViewModelProps<TViewModel>, React.HTMLProps<TView> {
}

export interface ViewModelState<T extends BaseViewModel> {
  viewModel: T;
}

export abstract class BaseView<TViewProps extends ViewModelProps<TViewModel>, TViewModel extends BaseViewModel> extends React.Component<TViewProps, ViewModelState<TViewModel>> implements AnonymousSubscription {
  public static displayName = 'BaseView';

  private updateSubscription: Subscription;<commit_msg>BaseViewProps generic TView param is now optional it turns out we don't really need to define TView in almost every case, so we make it opt in<commit_after>import * as React from 'react';
import { Iterable } from 'ix';
import { Observable, Subscription } from 'rxjs';
import { AnonymousSubscription, TeardownLogic } from 'rxjs/Subscription';

import { IterableLike, Property, Command } from '../../WebRx';
import { ReactSpreadResult, ReactSpreadRestrictedProps, reactRestrictedProps } from '../../Extensions/React';
import { Alert, Logging } from '../../Utils';
import { ViewModelLifecyle } from './Interfaces';
import { BaseViewModel, isViewModelLifecycle } from './BaseViewModel';
import { renderIterable, renderConditional, renderNullable, renderLoadable, renderSizedLoadable, renderGridLoadable, focusElement, classNames } from './RenderHelpers';
import { bindObservableToCommand, bindEventToProperty, bindEventToCommand } from './BindingHelpers';

export interface ViewModelProps<T extends BaseViewModel> {
  viewModel: Readonly<T>;
}

export type ReactSpreadRestrictedViewModelProps = ReactSpreadRestrictedProps & Partial<ViewModelProps<any>>;

export const reactSpreadRestrictedViewModelProps: ReactSpreadRestrictedViewModelProps = Object.assign(
  { viewModel: undefined },
  reactRestrictedProps,
);

export interface BaseViewProps<TViewModel extends BaseViewModel, TView = any> extends ViewModelProps<TViewModel>, React.HTMLProps<TView> {
}

export interface ViewModelState<T extends BaseViewModel> {
  viewModel: T;
}

export abstract class BaseView<TViewProps extends ViewModelProps<TViewModel>, TViewModel extends BaseViewModel> extends React.Component<TViewProps, ViewModelState<TViewModel>> implements AnonymousSubscription {
  public static displayName = 'BaseView';

  private updateSubscription: Subscription;
{'fraction_non_alphanumeric': 0.09349246945154874, 'fraction_numerical': 0.0, 'mean_word_length': 7.054919908466819, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '502482', 'n_tokens_mistral': 940, 'n_tokens_neox': 903, 'n_words': 264}