2 ms·
I've used shoelace components, overall I've been happy with them. The only parts I don't like are the event based APIs. It's 2022, I feel like we've settled o
by claytongulick 5y ago
I've used shoelace components, overall I've been happy with them.
The only parts I don't like are the event based APIs.
It's 2022, I feel like we've settled on promises as the best way to handle async.
The author wasn't particularly receptive to the issue I raised around it, even offering to create a PR.
I think event based APIs are really holding what would otherwise be a very nice component set back.
- __ryan__ 5y agoYou think being event based is holding back a web component library? When the DOM is event based now?
- dorianmariefr 5y agodo you have code samples of what you mean or the issue?
- abraham 5y agohttps://github.com/shoelace-style/shoelace/issues/376 https://github.com/shoelace-style/shoelace/issues/376
- craigmcnamara 5y agoEvents are foundational to JS, we've had them since the beginning and they're not broken. You don't need any nonsense to use them. They're also completely unrelated to promises in my opinion, so I'm not even sure what the ecosystem would look like if you tried to replace Events with promises.
- peteforde 5y agoEvents, promises and callback functions all work differently, exist in their own lanes and can co-exist in the same library. Each one is perfect in the use case it was designed for. That said, while promises are a very useful tool, I consistently find events to be an easier mental model to work with in the context of the DOM. This is primarily due to the bubbling nature of events. It's entirely possible that you and your friends concluded in a bubble that promises are the pattern to rule them all, but don't speak for all of us.