Skip to content

Instantly share code, notes, and snippets.

@webpapaya
Created October 16, 2020 10:48
Show Gist options
  • Save webpapaya/4b60c44eb23f5d7bff913707ca8abbfa to your computer and use it in GitHub Desktop.
Save webpapaya/4b60c44eb23f5d7bff913707ca8abbfa to your computer and use it in GitHub Desktop.
  • You're building an issue tracking system
  • Build a component which displays the names of assignees
    • eg. <Assignees assignees={['Mike', 'Sepp', 'David']} />
    • build a simple ul
  • WITH more than 3 assigness,
    • only display 3 assignees
    • display a show more button
  • WHEN the show more button was clicked
    • display all assignees
    • a show less button is displayed instead of a show more button
    • AND the show less button was clicked, only displays 3 assignees
  • WITH less than 4 assignees,
    • don't display a "show more" button
@wolframkriesing
Copy link

Do you have some more constraints?
Even when you have some they can be adjusted, but I think it is helpful.
What kind of constraints do I mean?
E.g.:

  • do it with pure JS, no react involved OR
  • cover all aspects of rendering, even the resulting HTML must be validated
  • tests must run in <1sec
  • use react hooks
  • don't use react hooks
  • use react-testing-library
  • ...

while writing this, I thought that the goal of "what to learn" might determine which constraints you choose or suggest
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment