Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

extractValue.md

34 lines548 Bytes

1---
2id: extractValue
3title: extractValue
4---
5​
6```ts
7function extractValue(expr): any;
8```
9​
10Defined in: [packages/db/src/query/expression-helpers.ts:130](https://github.com/TanStack/db/blob/main/packages/db/src/query/expression-helpers.ts#L130)
11​
12Extracts the value from a Value expression.
13Returns undefined for non-value expressions.
14​
15## Parameters
16​
17### expr
18​
19`BasicExpression`
20​
21The expression to extract from
22​
23## Returns
24​
25`any`
26​
27The extracted value
28​
29## Example
30​
31```typescript
32const val = extractValue(someExpression)
33// Returns: 'electronics'
34```