@cratis/arc 20.5.0 → 20.5.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/dist/cjs/queries/QueryResult.js +1 -1
- package/dist/cjs/queries/QueryResult.js.map +1 -1
- package/dist/cjs/queries/QueryResultWithState.js +3 -3
- package/dist/cjs/queries/QueryResultWithState.js.map +1 -1
- package/dist/cjs/queries/WebSocketHubConnection.d.ts +8 -8
- package/dist/cjs/queries/WebSocketHubConnection.d.ts.map +1 -1
- package/dist/cjs/queries/WebSocketHubConnection.js +8 -8
- package/dist/cjs/queries/WebSocketHubConnection.js.map +1 -1
- package/dist/esm/queries/QueryResult.js +1 -1
- package/dist/esm/queries/QueryResult.js.map +1 -1
- package/dist/esm/queries/QueryResultWithState.js +3 -3
- package/dist/esm/queries/QueryResultWithState.js.map +1 -1
- package/dist/esm/queries/WebSocketHubConnection.d.ts +8 -8
- package/dist/esm/queries/WebSocketHubConnection.d.ts.map +1 -1
- package/dist/esm/queries/WebSocketHubConnection.js +8 -8
- package/dist/esm/queries/WebSocketHubConnection.js.map +1 -1
- package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.js +2 -3
- package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.js.map +1 -1
- package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.js +1 -2
- package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.js.map +1 -1
- package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.js +1 -2
- package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.js.map +1 -1
- package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.js +1 -2
- package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.js.map +1 -1
- package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.js +1 -2
- package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/queries/QueryResult.ts +1 -1
- package/queries/QueryResultWithState.ts +3 -3
- package/queries/WebSocketHubConnection.ts +9 -9
- package/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.ts +2 -3
- package/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.ts +1 -2
- package/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.ts +1 -2
- package/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.ts +1 -2
- package/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.ts +1 -2
package/package.json
CHANGED
package/queries/QueryResult.ts
CHANGED
|
@@ -130,7 +130,7 @@ export class QueryResult<TDataType = object> implements IQueryResult<TDataType>
|
|
|
130
130
|
|
|
131
131
|
this.data = data as TDataType;
|
|
132
132
|
} else {
|
|
133
|
-
this.data = (enumerable ? [] :
|
|
133
|
+
this.data = (enumerable ? [] : null) as TDataType;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -13,7 +13,7 @@ export class QueryResultWithState<TDataType> implements IQueryResult<TDataType>
|
|
|
13
13
|
|
|
14
14
|
static empty<TDataType>(defaultValue: TDataType): QueryResultWithState<TDataType> {
|
|
15
15
|
return new QueryResultWithState(
|
|
16
|
-
defaultValue
|
|
16
|
+
defaultValue,
|
|
17
17
|
PagingInfo.noPaging,
|
|
18
18
|
true,
|
|
19
19
|
true,
|
|
@@ -27,7 +27,7 @@ export class QueryResultWithState<TDataType> implements IQueryResult<TDataType>
|
|
|
27
27
|
|
|
28
28
|
static initial<TDataType>(defaultValue: TDataType): QueryResultWithState<TDataType> {
|
|
29
29
|
return new QueryResultWithState(
|
|
30
|
-
defaultValue
|
|
30
|
+
defaultValue,
|
|
31
31
|
PagingInfo.noPaging,
|
|
32
32
|
true,
|
|
33
33
|
true,
|
|
@@ -81,7 +81,7 @@ export class QueryResultWithState<TDataType> implements IQueryResult<TDataType>
|
|
|
81
81
|
*/
|
|
82
82
|
static fromQueryResult<TDataType>(queryResult: QueryResult<TDataType>, isPerforming: boolean) {
|
|
83
83
|
return new QueryResultWithState<TDataType>(
|
|
84
|
-
queryResult.data
|
|
84
|
+
queryResult.data,
|
|
85
85
|
queryResult.paging,
|
|
86
86
|
queryResult.isSuccess,
|
|
87
87
|
queryResult.isAuthorized,
|
|
@@ -12,17 +12,17 @@ import { QueryResult } from './QueryResult';
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Message types matching the backend {@link ObservableQueryHubMessageType} enum.
|
|
15
|
-
* Serialized as
|
|
15
|
+
* Serialized as strings by the JsonStringEnumConverter on the server.
|
|
16
16
|
*/
|
|
17
17
|
export enum HubMessageType {
|
|
18
|
-
Subscribe =
|
|
19
|
-
Unsubscribe =
|
|
20
|
-
QueryResult =
|
|
21
|
-
Unauthorized =
|
|
22
|
-
Error =
|
|
23
|
-
Ping =
|
|
24
|
-
Pong =
|
|
25
|
-
Connected =
|
|
18
|
+
Subscribe = 'Subscribe',
|
|
19
|
+
Unsubscribe = 'Unsubscribe',
|
|
20
|
+
QueryResult = 'QueryResult',
|
|
21
|
+
Unauthorized = 'Unauthorized',
|
|
22
|
+
Error = 'Error',
|
|
23
|
+
Ping = 'Ping',
|
|
24
|
+
Pong = 'Pong',
|
|
25
|
+
Connected = 'Connected',
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -23,7 +23,6 @@ describe('when asking has data and it is null for non-enumerable query', () => {
|
|
|
23
23
|
data: null
|
|
24
24
|
}, Object, false);
|
|
25
25
|
|
|
26
|
-
it('should
|
|
27
|
-
it('should have data that is
|
|
28
|
-
it('should have data that is an empty object', () => queryResult.data.should.deep.equal({}));
|
|
26
|
+
it('should not have data since null data means no data', () => queryResult.hasData.should.be.false);
|
|
27
|
+
it('should have data that is null', () => (queryResult.data === null).should.be.true);
|
|
29
28
|
});
|
|
@@ -6,8 +6,7 @@ import { QueryResultWithState } from '../../QueryResultWithState';
|
|
|
6
6
|
describe('when creating empty with null default value', () => {
|
|
7
7
|
const result = QueryResultWithState.empty<string[]>(null as unknown as string[]);
|
|
8
8
|
|
|
9
|
-
it('should have data
|
|
10
|
-
it('should have data that is not null', () => (result.data !== null).should.be.true);
|
|
9
|
+
it('should have null data since null defaultValue is passed through', () => (result.data === null).should.be.true);
|
|
11
10
|
it('should not have data', () => result.hasData.should.be.false);
|
|
12
11
|
it('should not be performing', () => result.isPerforming.should.be.false);
|
|
13
12
|
});
|
package/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.ts
CHANGED
|
@@ -6,8 +6,7 @@ import { QueryResultWithState } from '../../QueryResultWithState';
|
|
|
6
6
|
describe('when creating empty with undefined default value', () => {
|
|
7
7
|
const result = QueryResultWithState.empty<string[]>(undefined as unknown as string[]);
|
|
8
8
|
|
|
9
|
-
it('should have data
|
|
10
|
-
it('should have data that is not null', () => (result.data !== null).should.be.true);
|
|
9
|
+
it('should have undefined data since undefined defaultValue is passed through', () => (result.data === undefined).should.be.true);
|
|
11
10
|
it('should not have data', () => result.hasData.should.be.false);
|
|
12
11
|
it('should not be performing', () => result.isPerforming.should.be.false);
|
|
13
12
|
});
|
|
@@ -6,8 +6,7 @@ import { QueryResultWithState } from '../../QueryResultWithState';
|
|
|
6
6
|
describe('when creating initial with null default value', () => {
|
|
7
7
|
const result = QueryResultWithState.initial<string[]>(null as unknown as string[]);
|
|
8
8
|
|
|
9
|
-
it('should have data
|
|
10
|
-
it('should have data that is not null', () => (result.data !== null).should.be.true);
|
|
9
|
+
it('should have null data since null defaultValue is passed through', () => (result.data === null).should.be.true);
|
|
11
10
|
it('should not have data', () => result.hasData.should.be.false);
|
|
12
11
|
it('should be performing', () => result.isPerforming.should.be.true);
|
|
13
12
|
});
|
package/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.ts
CHANGED
|
@@ -6,8 +6,7 @@ import { QueryResultWithState } from '../../QueryResultWithState';
|
|
|
6
6
|
describe('when creating initial with undefined default value', () => {
|
|
7
7
|
const result = QueryResultWithState.initial<string[]>(undefined as unknown as string[]);
|
|
8
8
|
|
|
9
|
-
it('should have data
|
|
10
|
-
it('should have data that is not null', () => (result.data !== null).should.be.true);
|
|
9
|
+
it('should have undefined data since undefined defaultValue is passed through', () => (result.data === undefined).should.be.true);
|
|
11
10
|
it('should not have data', () => result.hasData.should.be.false);
|
|
12
11
|
it('should be performing', () => result.isPerforming.should.be.true);
|
|
13
12
|
});
|