Skip to content
This repository has been archived by the owner on Nov 14, 2019. It is now read-only.
/ typist Public archive

Human-like typing for javascript projects

Notifications You must be signed in to change notification settings

aeciorc/typist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Typist

A really simple javascript utility for simulating human-like typing.

Usage

typist(text, textHandler); Where text is whatever you want to be typed and handler is your function that modifies the value of the element that will display the text.

React example:
Class LandingPage extends React.Component {
  text =
    "One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections";

  componentDidMount() {
    typist(this.text, this.handleChange);
  }

  state = {
    visible: ""
  };

  handleChange = visible => {
    this.setState({ visible });
  };
  render() {
    const { classes } = this.props;
    return (
      <div>
        <Header classes={classes} />

        <Typography> {this.state.visible}</Typography>
      </div>
    );
  }
}```

About

Human-like typing for javascript projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published