playlist-generator's Introduction
playlist-generator's People
playlist-generator's Issues
Use .length to check for empty arrays
uris
would still return true
for an empty array since it is still defined. To check if an array is empty, use .length
:
if (!(playlistName && uris.length)) {
https://github.com/ossan-engineer/playlist-generator/blob/master/src/util/Spotify.js#L57
async functions
Don't forget the async
keyword for your function, otherwise you would get an error when trying to save a playlist with no name/tracks.
savePlaylist: async (playlistName, uris) => {
https://github.com/ossan-engineer/playlist-generator/blob/master/src/util/Spotify.js#L56
Summary
(Meets Expectations)
Great job on this project! It looks like you have a good understanding of the structure of the app as well as each individual components. Overall nice work with the requests as well!
As a further challenge, continue to explore the Spotify API and see if you're able to add more features to this app. As you do, be sure to pay attention to the required parameters for making a request to an endpoint, and make sure they are included so it does not result in an error (#1, #3 ). Happy coding!
value instead of defaultValue
Use the value
attribute instead of defaultValue
for input
so the playlist name will reset after you've saved it.
Empty search term
Don't forget to add a check for blank search terms, as you would get a 400 Bad Request Error when trying to make the request to the Spotify API with empty search.
https://github.com/ossan-engineer/playlist-generator/blob/master/src/components/App/App.js#L73-L76
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.