Giter Site home page Giter Site logo

asset-price-tracker's Introduction

Asset Price Tracker

Time spent: ~2h

Versions

Node: v12.11+ Angular: v11.2.13 RxJS: v6.6.0

Install

  1. npm install
  2. npm start
  3. go to http://localhost:4200/

Features

  • Usage of RxJS
  • Saving/Restoring state via query params
  • Accessibility
  • Responsive Design

Q&A

What happens in case the websocket disconnects?
Normally, when websocket disconnects you will get onclose event with code which will indicate a reason of the disconnection.

How would you go further to keep the live data available or inform the user?
If it's some kind of BE error I would try to re-establish websocket connection and subscribe to its data again. Since user of the application always expects to see an actual data, it makes sense to show him notification/alert massage about connection problems and prevent his use of API endpoints (so he won't buy a stock without knowing actual price of it).

What happens if a user adds an instrument multiple times to their list? Please discuss possible challenges and mitigations.
If user adds an instrument multiple times the problem would be to unsubscribe from the WS event. Since we have only one source of data (WS) and multiple consumers of the data, if we unsubscribe from one event, then all other consumers would lose data from the event tpp. The problem can be solved by implementing Publisher-Subscriber Pattern, so we will have a Pub-Sub manager which won't unsubscribe from an event if there's at least one subscriber for the event.

asset-price-tracker's People

Watchers

Tony Babenko 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.