UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

50 lines (25 loc) 852 B
[**Kvaser CanKing GUI Extensions SDK v7.5.1**](../../README.md) *** [Kvaser CanKing GUI Extensions SDK](../../modules.md) / [hooks](../README.md) / useProjectData # Function: useProjectData() > **useProjectData**\<`T`\>(`id`, `defaultValue`): `object` A hook for data that should be saved to the current project. ## Type Parameters ### T `T` ## Parameters ### id `number` The unique id of the view. ### defaultValue The default value or a function that returns the default value. `T` | () => `T` ## Returns `object` An object with a flag indicating if the project data has been initialized, the current project data and a setter callback. ### projectData > **projectData**: `T` ### projectDataIsInitialized > **projectDataIsInitialized**: `boolean` ### setProjectData > **setProjectData**: `Dispatch`\<`SetStateAction`\<`T`\>\>