// Vendor import * as React from 'react'; import { number } from '@storybook/addon-knobs'; // Internal import readme from '../README.md'; import { addition, subtraction } from './index'; import { name } from '../package.json'; const story = (stories: any) => { const earth = ( 🌎 ); const demo = () => { const options = { max: 10, min: 0, range: true, step: 1 }; const number1 = number('Number 1', 4, options); const number2 = number('Number 2', 3, options); const additionResult = addition(number1, number2); const subtractionResult = subtraction(number1, number2); return (

Utility Package

Not for production use!

  1. This is a{' '} {earth}public {earth} {' '} which will be available on the NPM registry to the general public.
  2. Interactive demo of a non React based package

This technique may prove useful for any high-level helpers or utility packages we create. Not to be confused as a replacement for good tests, rather a way to further improve visibility around what we've already built.

Addition

{number1} + {number2} = {additionResult}

Subtraction

{number1} - {number2} = {subtractionResult}

); }; // Now we load up a simple story for this component stories.addParameters({ readme: { sidebar: readme } }); stories.addWithJSX(name, demo); }; export { story as OpenSource };