ktmud commented on a change in pull request #11502:
URL: 
https://github.com/apache/incubator-superset/pull/11502#discussion_r516417810



##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -299,64 +301,85 @@ export function useSingleViewResource<D extends object = 
any>(
   };
 }
 
-// the hooks api has some known limitations around stale state in closures.
-// See 
https://github.com/reactjs/rfcs/blob/master/text/0068-react-hooks.md#drawbacks
-// the useRef hook is a way of getting around these limitations by having a 
consistent ref
-// that points to the most recent value.
+enum FavStarClassName {
+  CHART = 'slice',
+  DASHBOARD = 'Dashboard',
+}
+
+type FavoriteStatusResponse = {
+  result: Array<{
+    id: string;
+    value: boolean;
+  }>;
+};
+
+const favoriteApis = {
+  chart: makeApi<string, FavoriteStatusResponse>({

Review comment:
       You can also pass a json object to the request payload, which would be 
better suited for large search params and strong typing.
   
   In the future, we may even add built-in rison support so that rison requests 
can have typing, too.

##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -299,64 +301,85 @@ export function useSingleViewResource<D extends object = 
any>(
   };
 }
 
-// the hooks api has some known limitations around stale state in closures.
-// See 
https://github.com/reactjs/rfcs/blob/master/text/0068-react-hooks.md#drawbacks
-// the useRef hook is a way of getting around these limitations by having a 
consistent ref
-// that points to the most recent value.
+enum FavStarClassName {
+  CHART = 'slice',
+  DASHBOARD = 'Dashboard',
+}
+
+type FavoriteStatusResponse = {
+  result: Array<{
+    id: string;
+    value: boolean;
+  }>;
+};
+
+const favoriteApis = {
+  chart: makeApi<string, FavoriteStatusResponse>({

Review comment:
       I'd vote for `requestType: "rison"` so to not add a new config option.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to