Skip to content

suess-ecbm/svelte-coingecko-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


svelte app

Searching functionality problem:

'cardano' === 'Cardano' false 'card' === 'Cardano' false

Solution:

'Cardano'.toLowerCase().include('card') true 'Cardano'.toLowerCase().include('ard') true 'Cardano'.toLowerCase().include('rd') true

in Code:

const searchCoin = (value)=>{ coins = coins.filter((coin)=> coin.name.toLowerCase().includes(value.toLowerCase()) ) }

We filter the coinList depending of the user input, we compare input value with coin.name update the value of {coins} See if there is any value included and we counted as 'Cardano', also to lowerCase both (INPUT and API value coin.name) for accurate comparison

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published