useBlueprint
Hook to fetch a Blueprint from the DMSS API
Parameters
Name | Type | Optional | Description |
---|---|---|---|
typeRef | string | False | The reference to the blueprint to retrieve |
Returns
A list containing the blueprint document, a boolean representing the loading state, and an Error, if any.
Usage
Code example:
import { useBlueprint } from '@data-modelling-tool/core' const [blueprint, isLoading, error] = useBlueprint('someType') if (isLoading) return <div>Loading...</div> if (error) return <div>Error getting the blueprint</div> if (blueprint) { return (<p>Blueprint: {blueprint?.name} ({blueprint?.type})</p>) }