Git Product home page Git Product logo

statechart-calculator's Introduction

Simple calculator built using statecharts

Implementation of calculator using statechart as described in Ian Horrock's book - 'Constructing the User Interface'

Calculator screenshot

The demo can be found on codesandbox - https://codesandbox.io/s/github/mukeshsoni/statechart-calculator/tree/master/

To test it locally, clone the repository and run the following commands on your terminal

$ git clone https://github.com/mukeshsoni/statechart-calculator.git
$ cd statechart-calculator
$ npm install
$ npm run start

statechart-calculator's People

Contributors

mukeshsoni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

statechart-calculator's Issues

Move calculation and state handling into machine

Thanks for writing this example statechart for xState. I am currently putting together an API Server for xState charts and would like to include your calculator as an example.
For that to work, the machine itself must be self contained. That means it should be usable without external dependencies.

In your example here you do the state management and calculations in the react component. Would it be possible to separate the two concerns: state and UI a bit more?
It would make the react component leaner and I could just include your machine.js in my API server.

What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.