Code Monkey home page Code Monkey logo

all-the-countries's Introduction

๐ŸŒŽ All the Countries

A simple app listing all the countries of the world along with flags, capital cities and info


Build Instructions

  • Get the code: git clone https://github.com/Lissy93/all-the-countries.git
  • Navigate into project cd all-the-countries
  • Install dependencies yarn
  • Start development server yarn dev
  • Build production appp yarn build

ยฉ Alicia Sykes 2021
Licensed under MIT

all-the-countries's People

Contributors

beginci avatar lissy93 avatar worldworm 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

Watchers

 avatar  avatar  avatar  avatar

all-the-countries's Issues

Currencies are overwritten after a new compute cycle

Hello there!
first of all: what a nice little project! ๐Ÿ’Ž

I noticed that when you first load the page, the currency for each country is filled correctly. However, as soon as you search for a country, the currency is directly replaced by "undefined (undefined)".
grafik

After a bit of fiddling around, it seems to me that it's because the data is created in a computed properties, which overwrites the object country itself in the formatRawData
And if I understand stackoverflow correctly, computed properties seem to be "call by reference" and thus modify the RawCountriesData object. (but I can be completely wrong)

I would love to help and try to fix it. I'm not sure what the right approach is here though.

  • I could move the whole thing from computed to a method. However, I would have said it is correct in a computed.
  • I could map the whole object in the formatRawData into a completely new object so as not to touch the original object. But that's not nice either somehow.
  • A small if statement here to check if it has already been converted

Do you have a suggestion or a better idea? ๐Ÿ˜…
Please let me know and I would be happy to create a pull request.

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.