* Get the single value
(
session?: ResolutionOptionsOrSession,
)
| 253 | * Get the single value |
| 254 | */ |
| 255 | async singleValue( |
| 256 | session?: ResolutionOptionsOrSession, |
| 257 | ): Promise<T | undefined> { |
| 258 | const values = await this.values(session); |
| 259 | if (values.length === 0) return undefined; |
| 260 | if (values.length === 1) return values[0]; |
| 261 | throw new Error( |
| 262 | 'The ContextView has more than one value. Use values() to access them.', |
| 263 | ); |
| 264 | } |
| 265 | |
| 266 | /** |
| 267 | * The "bind" event is emitted when a new binding is added to the view. |
no test coverage detected