@ngx-signal-store-query/core
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "@ngx-signal-store-query/core", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Signal Store feature that bridges with Angular Query", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,1 +1,3 @@ | ||
export { withMutation } from './with-mutation'; | ||
export { withQuery } from './with-query'; | ||
export type { CreateMutationFn, CreateQueryFn } from './types'; |
@@ -52,6 +52,6 @@ # ngx-signal-store-query | ||
<pre> | ||
Loading: {{ store.exampleQuery().isLoading() }} | ||
Fetching: {{ store.exampleQuery().isFetching() }} | ||
Loading: {{ store.exampleQuery.isLoading() }} | ||
Fetching: {{ store.exampleQuery.isFetching() }} | ||
Data: | ||
{{ store.exampleQuery().data() | json }} | ||
{{ store.exampleQuery.data() | json }} | ||
</pre> | ||
@@ -58,0 +58,0 @@ `, |
@@ -1,9 +0,5 @@ | ||
import { type EmptyFeatureResult, type Prettify, type SignalStoreFeature, type SignalStoreFeatureResult, type StateSignals, type WritableStateSource } from '@ngrx/signals'; | ||
import { type CreateQueryResult, injectQuery } from '@tanstack/angular-query-experimental'; | ||
export declare function withQuery<Input extends SignalStoreFeatureResult, QueryName extends string, Store = QueryStore<Input>, DataFnType = unknown, DataType = DataFnType, ErrorType = Error, QueryKey extends readonly unknown[] = readonly unknown[]>(queryName: QueryName, createQueryFn: (store: Store) => QueryFactory<DataFnType, DataType, ErrorType, QueryKey>): SignalStoreFeature<Input, EmptyFeatureResult & { | ||
state: Record<QueryProp<QueryName>, CreateQueryResult<DataType, ErrorType>>; | ||
import { type EmptyFeatureResult, type SignalStoreFeature, type SignalStoreFeatureResult } from '@ngrx/signals'; | ||
import { type CreateQueryFn, type QueryMethod, type QueryProp } from './types'; | ||
export declare const withQuery: <Name extends string, TDataFn = unknown, TData = TDataFn, TError = Error, Input extends SignalStoreFeatureResult = SignalStoreFeatureResult>(name: Name, createQueryFn: CreateQueryFn<TDataFn, TData, TError, Input>) => SignalStoreFeature<Input, EmptyFeatureResult & { | ||
methods: Record<QueryProp<Name>, QueryMethod<TData, TError>>; | ||
}>; | ||
type QueryStore<Input extends SignalStoreFeatureResult> = Prettify<StateSignals<Input['state']> & Input['computed'] & Input['methods'] & WritableStateSource<Prettify<Input['state']>>>; | ||
type QueryProp<QueryName extends string> = `${Uncapitalize<QueryName>}Query`; | ||
type QueryFactory<DataFnType = unknown, DataType = DataFnType, ErrorType = Error, QueryKey extends readonly unknown[] = readonly unknown[]> = Parameters<typeof injectQuery<DataFnType, ErrorType, DataType, QueryKey>>[0]; | ||
export {}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26021
17
118