-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project list view: Fetch notebooks for projects only on row render
- Loading branch information
1 parent
a0d40fd
commit d121dd0
Showing
4 changed files
with
21 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
import useFetchState, { FetchState } from '~/utilities/useFetchState'; | ||
import { NotebookKind } from '~/k8sTypes'; | ||
import { getNotebooks } from '~/api'; | ||
import { POLL_INTERVAL } from '~/utilities/const'; | ||
|
||
export const useWatchNotebooks = ( | ||
namespace: string, | ||
refreshRate = POLL_INTERVAL, | ||
): FetchState<NotebookKind[]> => | ||
useFetchState<NotebookKind[]>( | ||
React.useCallback(() => getNotebooks(namespace), [namespace]), | ||
[], | ||
{ refreshRate }, | ||
); |
This file was deleted.
Oops, something went wrong.