Home / File/ index.js — react Source File

index.js — react Source File

Architecture documentation for index.js, a javascript file in the react codebase. 4 imports, 0 dependents.

File javascript BabelCompiler Entrypoint 4 imports 1 classes

Entity Profile

Dependency Diagram

graph LR
  25ef52bb_f0a9_64ed_5864_285651c93cc8["index.js"]
  43315ad6_972b_89f2_a26c_ae2c6075675a["FixtureSet.js"]
  25ef52bb_f0a9_64ed_5864_285651c93cc8 --> 43315ad6_972b_89f2_a26c_ae2c6075675a
  f3e4d030_5f7e_b1af_0ae5_fcdf80961e8c["FixtureSet"]
  25ef52bb_f0a9_64ed_5864_285651c93cc8 --> f3e4d030_5f7e_b1af_0ae5_fcdf80961e8c
  14dde3c9_48ef_6e34_3667_978d06aff15d["TestCase.js"]
  25ef52bb_f0a9_64ed_5864_285651c93cc8 --> 14dde3c9_48ef_6e34_3667_978d06aff15d
  e1e356f5_b085_dad5_a81f_4b4844381311["TestCase"]
  25ef52bb_f0a9_64ed_5864_285651c93cc8 --> e1e356f5_b085_dad5_a81f_4b4844381311
  style 25ef52bb_f0a9_64ed_5864_285651c93cc8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import FixtureSet from '../../FixtureSet';
import TestCase from '../../TestCase';

const React = window.React;

export default class MediaEvents extends React.Component {
  state = {
    playbackRate: 2,
    events: {
      onCanPlay: false,
      onCanPlayThrough: false,
      onDurationChange: false,
      onEmptied: false,
      onEnded: false,
      onError: false,
      onLoadedData: false,
      onLoadedMetadata: false,
      onLoadStart: false,
      onPause: false,
      onPlay: false,
      onPlaying: false,
      onProgress: false,
      onRateChange: false,
      onResize: false,
      onSeeked: false,
      onSeeking: false,
      onSuspend: false,
      onTimeUpdate: false,
      onVolumeChange: false,
      onWaiting: false,
    },
  };

  updatePlaybackRate = () => {
    this.video.playbackRate = 2;
  };

  setVideo = el => {
    this.video = el;
  };

  eventDidFire(event) {
    this.setState({
      events: Object.assign({}, this.state.events, {[event]: true}),
    });
  }

  getProgress() {
    const events = Object.keys(this.state.events);
    const total = events.length;
    const fired = events.filter(type => this.state.events[type]).length;

    return fired / total;
  }

  render() {
    const events = Object.keys(this.state.events);
    const handlers = events.reduce((events, event) => {
      events[event] = this.eventDidFire.bind(this, event);
      return events;
// ... (63 more lines)

Domain

Subdomains

Classes

Frequently Asked Questions

What does index.js do?
index.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Entrypoint subdomain.
What does index.js depend on?
index.js imports 4 module(s): FixtureSet, FixtureSet.js, TestCase, TestCase.js.
Where is index.js in the architecture?
index.js is located at fixtures/dom/src/components/fixtures/media-events/index.js (domain: BabelCompiler, subdomain: Entrypoint, directory: fixtures/dom/src/components/fixtures/media-events).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free