use-abcd 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/item.d.ts CHANGED
@@ -5,7 +5,11 @@ export declare class Item<T, C = unknown> {
5
5
  private _collection;
6
6
  private _id;
7
7
  private _cachedStatus;
8
+ private _refCount;
8
9
  constructor(collection: Collection<T, C>, id: string);
10
+ _retain(): void;
11
+ _release(): void;
12
+ get refCount(): number;
9
13
  get id(): string;
10
14
  get data(): T | undefined;
11
15
  update(mutate: (draft: Draft<T>) => void): void;
package/dist/useCrud.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Draft } from 'mutative';
2
2
  import { Config, Mutator } from './types';
3
- export type { Config, Change, SyncResult, ItemStatus, SyncQueueState, SyncState, ChangeType, ItemSyncStatus, } from './types';
3
+ export type { Config, Change, SyncResult, ItemStatus, SyncQueueState, SyncState, ChangeType, ItemSyncStatus, FetchState, } from './types';
4
4
  export declare function useCrud<T, C>(config: Config<T, C>): {
5
5
  items: Map<string, T>;
6
6
  context: C;
@@ -8,6 +8,8 @@ export declare function useCrud<T, C>(config: Config<T, C>): {
8
8
  syncQueue: import('./types').SyncQueueState<T>;
9
9
  loading: boolean;
10
10
  syncing: boolean;
11
+ fetchStatus: import('./types').FetchState;
12
+ fetchError: string;
11
13
  create: (item: T) => void;
12
14
  update: (id: string, mutate: (draft: Draft<T>) => void) => void;
13
15
  remove: (id: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-abcd",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Simple react hook for CRUD type apps",
5
5
  "repository": {
6
6
  "url": "https://github.com/smtrd3/use-abcd"