Add caching to the useEntityPermission hook (#9064)

* Add caching to the useEntityPermission hook

Signed-off-by: Joon Park <joonp@spotify.com>

* Remove useRef

Signed-off-by: Joon Park <joonp@spotify.com>

* Use useSWR hook

Signed-off-by: Joon Park <joonp@spotify.com>
This commit is contained in:
Joon Park
2022-02-02 04:49:04 -06:00
committed by GitHub
parent 74298c1ae3
commit 6acc8f7db7
5 changed files with 62 additions and 49 deletions
+2 -1
View File
@@ -32,7 +32,8 @@
"@backstage/plugin-permission-common": "^0.4.0",
"cross-fetch": "^3.0.6",
"react-router": "6.0.0-beta.0",
"react-use": "^17.2.4"
"react-use": "^17.2.4",
"swr": "^1.1.2"
},
"peerDependencies": {
"@types/react": "^16.13.1 || ^17.0.0",