getData() function
Obtains the value associated with a successful Result<T>
or throws an exception if the result is an error.
Signature:
typescript
export declare function getData<T>(result: Result<T>): T;
export declare function getData<T>(result: Result<T>): T;
Parameters
Parameter | Type | Description |
---|---|---|
result | Result<T> | The Result<T> from which to obtain the data property. |
Returns:
T
The value of the data
property.