Giter Site home page Giter Site logo

redux-bitcoin-price's Introduction

Redux Bitcoin Price Tracker

Build Status Deps Status DevDeps Status Codacy Badge

Bitcoin price tracker built with React, Redux, and Webpack, inspired by Preev. Uses Redux Thunk, ES7 async/await, and fetch to get exchange data, then calculates a weighted average and updates once every 10 seconds (updates the title tag too!).

screenshot

Stack

Why fetch() and async/await?

fetch returns a promise, so we can await the completion of a request in an async function!

(async () => {
  // fetch data
  const response = await fetch('https://apiv2.bitcoinaverage.com/constants/exchangerates/global');
  // read response to json format
  const json = await response.json();
  // the API gives us the number of Bitcoins in 1 USD, but we want
  // the number of USD in 1 BTC, so we can use the ES7 exponentiation operator
  return json.rates.BTC.rate ** -1;
})();

Todo

  • Search for '@todo' in the code
  • Making the text flash on updates would be nice
  • Add stocks and other things to exchange! (AAPL etc)
  • Use redux-actions handleAction in reducers
  • Use redux-form for form handling
  • Consolidate action files (getting data and form actions could be two categories)
  • Add an eslint config and more tests
  • Wrap switch statements in blocks and make sure they break or return
  • Better code coverage (write tests/cover fetch() fail)

redux-bitcoin-price's People

Contributors

nathanhleung avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

redux-bitcoin-price's Issues

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.