Skip to content

Instantly share code, notes, and snippets.

@khle
Created January 9, 2016 05:29
Show Gist options
  • Save khle/191ad0b8e79c6cb6fb88 to your computer and use it in GitHub Desktop.
Save khle/191ad0b8e79c6cb6fb88 to your computer and use it in GitHub Desktop.
Rx chat
var createRandomNickname = len => {
var text = '';
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for(var i = 0; i < len; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
};
ReactDOM.render(<Main nickname={createRandomNickname(6)}/>, document.getElementById('container'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment