(
config: LiveQueryCollectionConfig<TContext, TResult> & {
query: RootQueryFn<TQuery> | RootQueryBuilder<TQuery>
},
)
| 70 | * @returns Collection options that can be passed to createCollection |
| 71 | */ |
| 72 | export function liveQueryCollectionOptions< |
| 73 | TQuery extends QueryBuilder<any>, |
| 74 | TContext extends Context = ExtractContext<TQuery>, |
| 75 | TResult extends object = RootQueryResult<TContext>, |
| 76 | >( |
| 77 | config: LiveQueryCollectionConfig<TContext, TResult> & { |
| 78 | query: RootQueryFn<TQuery> | RootQueryBuilder<TQuery> |
| 79 | }, |
| 80 | ): CollectionConfigForContext<TContext, TResult> & { |
| 81 | utils: LiveQueryCollectionUtils |
| 82 | } { |
| 83 | const collectionConfigBuilder = new CollectionConfigBuilder< |
| 84 | TContext, |
| 85 | TResult |
| 86 | >(config) |
| 87 | return collectionConfigBuilder.getConfig() as CollectionConfigForContext< |
| 88 | TContext, |
| 89 | TResult |
| 90 | > & { utils: LiveQueryCollectionUtils } |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Creates a live query collection directly |
no test coverage detected