You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/02/18 23:55:24 UTC

[GitHub] [superset] suddjian commented on pull request #13218: refactor: Introduce api resource hooks, fetch owners for chart errors

suddjian commented on pull request #13218:
URL: https://github.com/apache/superset/pull/13218#issuecomment-781712801


   @ktmud At first I did consider an approach like your `useAsyncData` example, but I found that there was more that could be done when using a url as a resource identifier. This may not be obvious right now, since the hook doesn't yet have any extra bells and whistles attached, but this interface will allow us to add on some cool functionality later. Things like de-duplicating requests between components, utilizing local storage, caching results, streaming updates from the server, all without callers of the `useApiResource` hooks needing to change anything about their usage.
   
   That's also why I opted not to use the `processResponse` param. I wanted to keep the core api fetching hook as single-minded as possible, and treat the transformation as a sort of composed view of that data.
   
   I do wonder if the stuff I mentioned would be better implemented inside the guts of `makeApi`, though 🤔 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org