Skip to content

randoml-js/react-randoml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version NPM downloads NPM license Codecov Travis Bundle size

About

RandoML implementation for React

How to Install

First, install the library in your project by npm:

$ npm install react-randoml

Or Yarn:

$ yarn add react-randoml

Getting Started

Options

RandoML options

Returned Values

RandoML methods

Example

useRandoml hook:

import React from 'react';
import { useRandoml } from 'react-randoml';

const App = () => {
  const { choose } = useRandoml(/* object with options (if needed) */);

  const randomValue = choose();

  return <h1>{randomValue}</h1>;
};

export default App;

withRandoml HOC:

import React from 'react';
import { withRandoml } from 'react-randoml';

const App = ({ choose }) => {
  const randomValue = choose();

  return <h1>{randomValue}</h1>;
};

export default withRandoml(/* object with options (if needed) */)(App);

License

This project is licensed under the MIT License © 2020-present Jakub Biesiada