Skip to content

Alphonso's nittpicking #67

@camelPhonso

Description

@camelPhonso

The site looks really neat!!!

I noticed this one pattern that happens a few times:

setBirdcage((prevCage) => {
      return prevCage.map((b) =>
        b.id === bird.id ? { ...b, quantity: b.quantity - 1 } : b
      );
    });

This is a silly issue to add, BUT:

  • love the ternary, nice one;
  • naming the mapped bird as 'b' got confusing to my tired out brain. I do actually think sometimes being more descriptive is preferable, like:
setBirdcage((prevCage) => {
     return prevCage.map((cagedBird) =>
       cagedBird.id === bird.id ? { ...b, quantity: cagedBird.quantity - 1 } : cagedBird
     );
   });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions