Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit f0d50c3

Browse files
committed
fixed typos
1 parent e41f2be commit f0d50c3

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

packages/core/tests/unit/runtime/subscription/sub.controller.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,13 @@ describe('SubController Tests', () => {
535535
);
536536
expect(callbackSubscriptionContainer.callback).toBe(dummyIntegration);
537537
expect(callbackSubscriptionContainer.ready).toBeTruthy();
538+
539+
// TODO find a way to spy on a class constructor without overwriting it
540+
// https://stackoverflow.com/questions/48219267/how-to-spy-on-a-class-constructor-jest/48486214
541+
// Because the below tests are not really related to this test,
542+
// they are checking if the CallbackSubscriptionContainer got called with the right parameters
543+
// by checking if CallbackSubscriptionContainer has set its properties correctly
544+
// Note:This 'issue' happens in multiple parts of the AgileTs test
538545
expect(callbackSubscriptionContainer.key).toBe('randomKey');
539546
expect(callbackSubscriptionContainer.proxyKeyMap).toStrictEqual({});
540547
expect(callbackSubscriptionContainer.proxyBased).toBeFalsy();

packages/react/src/hocs/AgileHOC.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const createHOC = (
9898

9999
constructor(props: any) {
100100
super(props);
101-
this.agileInstance = (() => agileInstance) as any;
101+
this.agileInstance = agileInstance;
102102
this.waitForMount = agileInstance.config.waitForMount;
103103
}
104104

@@ -107,7 +107,7 @@ const createHOC = (
107107
// We could generate a id for each component but this would also happen in the constructor so idk
108108
// https://github.com/facebook/react/issues/12906
109109
UNSAFE_componentWillMount() {
110-
// Create Subscription with Observer that have no Indicator and can't be merged into this.state (Rerender will be caused via force Update)
110+
// Create Subscription with Observer that have no Indicator and can't be merged into 'this.state' (Rerender will be caused via force Update)
111111
if (depsWithoutIndicator.length > 0) {
112112
this.agileInstance.subController.subscribeWithSubsArray(
113113
this,
@@ -116,7 +116,7 @@ const createHOC = (
116116
);
117117
}
118118

119-
// Create Subscription with Observer that have an Indicator (Rerender will be cause via mutating this.state)
119+
// Create Subscription with Observer that have an Indicator (Rerender will be cause via mutating 'this.state')
120120
if (depsWithIndicator) {
121121
const response = this.agileInstance.subController.subscribeWithSubsObject(
122122
this,
@@ -152,7 +152,7 @@ const createHOC = (
152152
//=========================================================================================================
153153
/**
154154
* @private
155-
* Extract Observers of dependencies which might not have an indicator.
155+
* Extract Observers from dependencies which might not have an indicator.
156156
* If a indicator could be found it will be added to 'depsWithIndicator' otherwise to 'depsWithoutIndicator'.
157157
* @param deps - Dependencies to be formatted
158158
*/
@@ -188,7 +188,7 @@ const formatDepsWithNoSafeIndicator = (
188188
//=========================================================================================================
189189
/**
190190
* @private
191-
* Extract Observers of dependencies which have an indicator through the object property key.
191+
* Extract Observers from dependencies which have an indicator through the object property key.
192192
* @param deps - Dependencies to be formatted
193193
*/
194194
const formatDepsWithIndicator = (deps: {

packages/vue/src/bindAgileInstances.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function bindAgileInstances(
1212
deps: DepsType,
1313
agile: Agile,
1414
vueComponent: Vue
15-
) {
15+
): { [key: string]: any } {
1616
let depsWithoutIndicator: Array<Observer> = [];
1717
let depsWithIndicator: DepsWithIndicatorType;
1818

@@ -25,7 +25,7 @@ export function bindAgileInstances(
2525
depsWithoutIndicator = response.depsWithoutIndicator;
2626
}
2727

28-
// Create Subscription with Observer that have no Indicator and can't be merged into the sharedState (Rerender will be caused via force Update)
28+
// Create Subscription with Observer that have no Indicator and can't be merged into the 'sharedState' (Rerender will be caused via force Update)
2929
if (depsWithoutIndicator.length > 0) {
3030
agile.subController.subscribeWithSubsArray(
3131
vueComponent,
@@ -34,7 +34,7 @@ export function bindAgileInstances(
3434
);
3535
}
3636

37-
// Create Subscription with Observer that have an Indicator (Rerender will be cause via mutating this.$data.sharedState)
37+
// Create Subscription with Observer that have an Indicator (Rerender will be cause via mutating 'this.$data.sharedState')
3838
if (depsWithIndicator) {
3939
return agile.subController.subscribeWithSubsObject(
4040
vueComponent,
@@ -51,7 +51,7 @@ export function bindAgileInstances(
5151
//=========================================================================================================
5252
/**
5353
* @private
54-
* Extract Observers of dependencies which might not have an indicator.
54+
* Extract Observers from dependencies which might not have an indicator.
5555
* If a indicator could be found it will be added to 'depsWithIndicator' otherwise to 'depsWithoutIndicator'.
5656
* @param deps - Dependencies to be formatted
5757
*/
@@ -87,7 +87,7 @@ const formatDepsWithNoSafeIndicator = (
8787
//=========================================================================================================
8888
/**
8989
* @private
90-
* Extract Observers of dependencies which have an indicator through the object property key.
90+
* Extract Observers from dependencies which have an indicator through the object property key.
9191
* @param deps - Dependencies to be formatted
9292
*/
9393
const formatDepsWithIndicator = (deps: {

packages/vue/src/vue.integration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const vueIntegration = new Integration<typeof Vue, Vue>({
1919
// Update existing Data or if a new one got created set it via Vue
2020
// Note: Not merging 'updateData' into 'componentData'
2121
// because Vue tracks the local State changes via Proxy
22-
// and by merging it, Vue couldn't detect the changes
22+
// and by merging it, Vue can't detect the changes
2323
for (const key of Object.keys(updatedData)) {
2424
if (Object.prototype.hasOwnProperty.call(componentData, key)) {
2525
componentData.sharedState[key] = updatedData[key];
@@ -40,12 +40,13 @@ const vueIntegration = new Integration<typeof Vue, Vue>({
4040
this.$agile = agile;
4141
},
4242
methods: {
43+
// TODO make 'bindAgileInstances' ('sharedState') more typesafe
4344
bindAgileInstances: function (
4445
deps: DepsType
4546
): { sharedState: { [key: string]: any } } {
4647
return {
4748
sharedState: {
48-
...(this.$root.$data.sharedState || {}),
49+
...(this?.$data?.sharedState || {}),
4950
...bindAgileInstances(deps, agile, this),
5051
},
5152
};

0 commit comments

Comments
 (0)