@instantdb/react 0.22.72 → 0.22.73-experimental.fix-use-dates.19710580517.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instantdb/react",
3
- "version": "0.22.72",
3
+ "version": "0.22.73-experimental.fix-use-dates.19710580517.1",
4
4
  "description": "Instant DB for React",
5
5
  "homepage": "https://github.com/instantdb/instant/tree/main/client/packages/react",
6
6
  "repository": {
@@ -54,9 +54,9 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "eventsource": "^4.0.0",
57
- "@instantdb/core": "0.22.72",
58
- "@instantdb/react-common": "0.22.72",
59
- "@instantdb/version": "0.22.72"
57
+ "@instantdb/core": "0.22.73-experimental.fix-use-dates.19710580517.1",
58
+ "@instantdb/react-common": "0.22.73-experimental.fix-use-dates.19710580517.1",
59
+ "@instantdb/version": "0.22.73-experimental.fix-use-dates.19710580517.1"
60
60
  },
61
61
  "scripts": {
62
62
  "test": "vitest",
@@ -4,10 +4,11 @@ import { EventSource } from 'eventsource';
4
4
 
5
5
  export default class InstantReactWebDatabase<
6
6
  Schema extends InstantSchemaDef<any, any, any>,
7
- Config extends InstantConfig<Schema, boolean> = InstantConfig<
7
+ UseDates extends boolean = false,
8
+ Config extends InstantConfig<Schema, UseDates> = InstantConfig<
8
9
  Schema,
9
- boolean
10
+ UseDates
10
11
  >,
11
- > extends InstantReactAbstractDatabase<Schema, Config> {
12
+ > extends InstantReactAbstractDatabase<Schema, UseDates, Config> {
12
13
  static EventSourceImpl = EventSource;
13
14
  }
package/src/init.ts CHANGED
@@ -31,14 +31,21 @@ export function init<
31
31
  Schema extends InstantSchemaDef<any, any, any> = InstantUnknownSchema,
32
32
  UseDates extends boolean = false,
33
33
  >(
34
- config: InstantConfig<Schema, UseDates>,
35
- ): InstantReactWebDatabase<Schema, InstantConfig<Schema, UseDates>> {
36
- return new InstantReactWebDatabase<Schema, InstantConfig<Schema, UseDates>>(
37
- config,
38
- {
39
- '@instantdb/react': version,
40
- },
41
- );
34
+ config: Omit<InstantConfig<Schema, UseDates>, 'useDateObjects'> & {
35
+ useDateObjects?: UseDates;
36
+ },
37
+ ): InstantReactWebDatabase<Schema, UseDates, InstantConfig<Schema, UseDates>> {
38
+ const configStrict = {
39
+ ...config,
40
+ useDateObjects: (config.useDateObjects ?? false) as UseDates,
41
+ };
42
+ return new InstantReactWebDatabase<
43
+ Schema,
44
+ UseDates,
45
+ InstantConfig<Schema, UseDates>
46
+ >(configStrict, {
47
+ '@instantdb/react': version,
48
+ });
42
49
  }
43
50
 
44
51
  /**