Projects: create useProjectDataProvider
hook
#363
Labels
extensions team
Able to be worked on by extensions team
Milestone
As an extension developer, I want to be able to get project data easily in React so I can easily make WebViews.
Create a hook
useProjectDataProvider
that retrieves a project with your specified project ID. Maybe this can be a thin layer over theuseDataProvider
hook? Or it will at least be quite similar.createProviderHook
function that we pass the appropriate retrieval function into likedataProviderService.get
andprojectDataProvider.getProjectDataProvider
? Not sure if all that code can be shared. That would be likeconst useDataProvider = createProviderHook(dataProviderService.get)
. So the current code inuseDataProvider
goes intocreateProviderHook
, andcreateProviderHook(getProvider: (id) => Provider)
returns a function that is theuseDataProvider
hook.useProjectDataProvider
will use a genericProjectType extends ProjectTypes
mapped type similar toproject-data-provider.service.ts
'sgetProjectDataProvider
. You can almost think of it as a hook over that function.Function signature:
Project Design Doc
Testing Note: Talk to Matt about how to load projects
The text was updated successfully, but these errors were encountered: