btnwtn / react-real-math

Do math with a DSL as easy as React.js!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-real-math

Do math with a DSL as easy as React.js!

Install

$ yarn add react-real-math

Example

import { computeValue, Add, Multiply, Subtract, One, Two, Four, Five } from 'react-real-math'

console.log("The answer to everything:", computeValue(
  <Add>
    <Two/>
    <Multiply by={<Four/>}>
      <Subtract by={<One/>}>
        <Add>
          <Five/>
          <Four/>
          <One/>
          <One/>
        </Add>
      </Subtract>
    </Multiply>
  </Add>
))

About

Do math with a DSL as easy as React.js!


Languages

Language:JavaScript 100.0%