Giter VIP home page Giter VIP logo

the-playing-god-app's Introduction

The Playing God App

Just a simple React app showing how to use the useReducer hook to manage a global-ish state object.

Inspiration

I got the inspiration for this app from this blog post.

What this is

This app is basically a combination of an unordered list of people, an input text field and some buttons for performing various actions.

Each person has the following properties:

  • Name
  • Life status (alive or dead)
  • Life count (a number signifying how many times you can be revived if you're dead)
  • Wallet (a number indicating how many coins you have, 1 coin can buy 1 life)

Next to each peson's properties is a row of three action buttons: KILL, REVIVE and BUY LIFE. The roles are self explanatory. Each button's active state is tied to several factors. For example, the KILL button is always active as long as the person is alive, the REVIVE button is active as long as the person is either dead or his/her life count is 1 or more, and, as expected, the BUY LIFE button is always active as long as the person's wallet has 1 or more coins.

You can create a new life by entering a person's name in the only text field available and clicking on the CREATE button. And, as expected, the CREATE button will only be active as long as there is some content in the text field.

Running

  1. Clone this repo: git clone https://github.com/dekarpaulvictor/The-Playing-God-App.git
  2. Change to app's root directory and run yarn or yarn add or npm install to install the app's dependencies
  3. Run yarn start or npm run start
  4. Access the app on http:localhost:3000, unless port 3000 is occupied

To do

  1. Styling
  2. Documentation
  3. Serious refactoring
  4. Tests

the-playing-god-app's People

Contributors

dekarpaulvictor avatar

Watchers

 avatar

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.