NEW PROJECT – Open Library Search

Category: | Posted on:February 25, 2024
open library search results

Added another API fetching project, Open Library Search. The app pings the Internet Archive‘s Open Library Search API to retrieve author, publication, purchase, and topic data for a user-provided book title.

Objective

My goal is to continue cranking out simple fetch projects until I can do them without relying on a crutch. I used my previous Public APIs List project to pick out the topic for this one. Open Library Search API provides a lot of data to work with in a mix of strings and arrays that provided an opportunity to diversify the formatting of the data.

Development

I’m settling into a pattern of establishing states for data, error, and loading right out of the gate. I also created a query state to capture the user’s input, then tied the data fetching function to a useEffect() hook with query as a dependency so that the search would fire each time the user submits a new title.

I almost got try/catch down blind, but I forgot to make my fetch asynchronous initially.

In my Public API List project I didn’t bother with Enter key functionality, but this time I added it. It’s more convenient for testing and I should make it a habit.

Hurdles

This went pretty smoothly and I didn’t encounter any major roadblocks. I do have a problem remembering array methods, however, and that’s a weakness I’m looking to overcome. This project required the use of several that I always forget about until I Google them. The fetch API is another area where I still need to reference syntax, but at this point I always know what I want to do and what’s needed.

Takeaways

I got to practice checking and handling array data with more depth than my past project. I got to use isArray(), .slice(), and .join(). I think I fully get props now and had no trouble passing data down through my components. The .map() method has clicked too. I just need to remember not to forget to add a  currentValue and index to the function inside.

Related Logs


  • UPDATE – Space Invaders

    January 28, 2025

    Quick presentational update to the Space Invaders project. Keep Shields Centered On Hit Shields will now automatically maintain a centered position when hit my an alien missile. I initially thought this was going to involve some math to determine whether the missile hit on the right or left side. I even put together a formula […]

    Continue Reading
  • NEW PROJECT – Space Invaders

    January 27, 2025

    Space Invaders is a bare-bones facsimile of the classic arcade game of the same name. Objective I wanted to take what I learned from the Asteroids Tutorial in my last project and iterate without the training wheels this time. Space Invaders has more lateral movement from the player and hostiles than in Asteroids, and has […]

    Continue Reading
  • NEW PROJECT – Asteroids

    January 9, 2025

    Asteroids is a bare-bones facsimile of the classic arcade game of the same name. Objective I want to focus on more creative projects this year in order to break up the grind of work skill development. I’ve always been passionate about game design, and there are a lot of free tools to chose from. My […]

    Continue Reading