New useDefered
composable as an alternative to the Deferred
component.
#2309
jorisvanandel
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Imagine there is some data that is being deferred in the controller, like so:
Imagine we want to render a button as loading until this deferred data becomes available. Right now, the only way (correct me if I'm wrong) to accomplish this would be something like this:
Now this becomes rather repetitive especially once the button has a bunch of props that are not dependent on the status of the deferred data. Wouldn't it be nice if we had a composable that works alongside the
Deferred
component?If we had a composable named
useComposable
, we could use it like so:Much cleaner, right? I'm using Laravel/React as an example here but this could be implemented for all adapters ofcourse.
Beta Was this translation helpful? Give feedback.
All reactions