question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey there!

I am coming to the Choo universe (chooniverse?) from React and so far I like the lighter-weight approach. There were some confusing things about the Nanocomponent API that held me up a bit. I’m curious about the reasoning behind the API method names.

  1. Why isn’t update() called something like shouldUpdate()? As a user, I would expect the component to re-render if I call this.update()
  2. Why are the lifecycle methods all lowercase, but don’t use the on prefix? Is there a precedent for this? Same issue as above, where I would expect load() and unload() to do something different. Maybe it would make more sense to use mount / unmount since those terms are used elsewhere in the Choo documentation?

These questions may have simple answers but they weren’t obvious to me. Thanks for all your work!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ungoldmancommented, Jul 13, 2019

Going to close this since changing method names in a future major release isn’t on the roadmap for now. Open to making this a priority if enough people feel it’s important.

Putting this issue to bed for now 🛌😴

1reaction
ungoldmancommented, Jul 13, 2019

Hi @blahah – I believe generally the idea was to follow existing conventions from the DOM spec. So createElement comes from document.createElement()

Read more comments on GitHub >

github_iconTop Results From Across the Web

Naming conventions | Cloud APIs
Names used in APIs should be in correct American English. · Commonly accepted short forms or abbreviations of long words may be used...
Read more >
Best Practices for Naming REST API Endpoints
Best Practices for Naming REST API Endpoints · Use Nouns to Name URIs · Use Clear, Unabridged Names That Are Intuitive · Use...
Read more >
10 Best Practices for Naming REST API Endpoints
10 Best Practices for Naming REST API Endpoints · 1. Use Nouns · 2. Use Intuitive, Clear Names · 3. Use Lowercase Letters...
Read more >
REST API - URL Naming Conventions
In REST, having a strong and consistent REST resource naming strategy – will prove one of the best design decisions in the long...
Read more >
REST API Naming Conventions and Best Practices
REST API Naming Conventions and Best Practices · Use Nouns to represent resources / Not Verbs · Use Pluralized Nouns for resources ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found