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

Commit 327bffb

Browse files
committed
removed 'removeProperties'
1 parent 359fd81 commit 327bffb

File tree

26 files changed

+97
-111
lines changed

26 files changed

+97
-111
lines changed

examples/react/develop/simple-counter/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
"eject": "react-scripts eject",
1010
"analyze": "yarn run build && source-map-explorer 'build/static/js/*.js'",
1111
"analyze:webpack": "node scripts/analyze.js",
12-
"install:dev:agile": "yalc add @agile-ts/core @agile-ts/react @agile-ts/logger & yarn install",
13-
"install:prod:agile": "yarn add @agile-ts/core @agile-ts/react @agile-ts/logger & yarn install"
12+
"install:dev:agile": "yalc add @agile-ts/core @agile-ts/react @agile-ts/logger @agile-ts/utils & yarn install",
13+
"install:prod:agile": "yarn add @agile-ts/core @agile-ts/react @agile-ts/logger @agile-ts/utils & yarn install"
1414
},
1515
"dependencies": {
1616
"@agile-ts/core": "file:.yalc/@agile-ts/core",
1717
"@agile-ts/logger": "file:.yalc/@agile-ts/logger",
1818
"@agile-ts/react": "file:.yalc/@agile-ts/react",
19+
"@agile-ts/utils": "file:.yalc/@agile-ts/utils",
1920
"@hookstate/core": "^3.0.8",
2021
"@reduxjs/toolkit": "^1.6.1",
2122
"dotenv": "^10.0.0",

examples/react/develop/simple-counter/yarn.lock

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33

44

55
"@agile-ts/core@file:.yalc/@agile-ts/core":
6-
version "0.2.0-alpha.3"
6+
version "0.2.6"
77
dependencies:
8-
"@agile-ts/utils" "^0.0.7"
8+
"@agile-ts/utils" "^0.0.10"
99

1010
"@agile-ts/logger@file:.yalc/@agile-ts/logger":
11-
version "0.0.7"
11+
version "0.0.10"
1212
dependencies:
13-
"@agile-ts/utils" "^0.0.7"
13+
"@agile-ts/utils" "^0.0.10"
1414

1515
"@agile-ts/react@file:.yalc/@agile-ts/react":
16-
version "0.1.2"
16+
version "0.2.2"
1717

18-
"@agile-ts/utils@^0.0.7":
19-
version "0.0.7"
20-
resolved "https://registry.yarnpkg.com/@agile-ts/utils/-/utils-0.0.7.tgz#3dd1add6b9f63d0a5bf35e71f54ac46448ae047f"
21-
integrity sha512-OviTDC+ZbfyiUx8Gy8veS6YymC/tT6UeP23nT8V0EQV4F2MmuWqZ2yiKk+AYxZx8h74Ey8BVEUX6/ntpxhSNPw==
18+
"@agile-ts/utils@^0.0.10":
19+
version "0.0.10"
20+
resolved "https://registry.yarnpkg.com/@agile-ts/utils/-/utils-0.0.10.tgz#5eb2d7b7faefc00c416165ad93c79237e8448bbd"
21+
integrity sha512-eVJZS60H8HaD8atTfswObihdDxjcxNlaoHk8Crmz85KOrdIMBMdrGx41p+Zf15s+dSfal1gbgM2In3bw4zjSww==
22+
23+
"@agile-ts/utils@file:.yalc/@agile-ts/utils":
24+
version "0.0.10"
2225

2326
"@babel/code-frame@7.10.4":
2427
version "7.10.4"

packages/core/src/collection/collection.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
isFunction,
66
isValidObject,
77
normalizeArray,
8-
removeProperties,
98
} from '@agile-ts/utils';
109
import { logCodeManager } from '../logCodeManager';
1110
import { Agile } from '../agile';
@@ -26,7 +25,7 @@ import { CollectionPersistent } from './collection.persistent';
2625

2726
export class Collection<
2827
DataType extends DefaultItem = DefaultItem,
29-
GroupValueType = Array<ItemKey> // To extract the Group Type Value in Integration methods like 'useAgile()'
28+
GroupValueType = Array<ItemKey> // To extract the Group Type Value in Integration methods like 'useValue()'
3029
> {
3130
// Agile Instance the Collection belongs to
3231
public agileInstance: () => Agile;
@@ -1089,10 +1088,7 @@ export class Collection<
10891088
const _itemKeys = normalizeArray(itemKeys);
10901089

10911090
// Remove itemKeys from old Group
1092-
this.getGroup(oldGroupKey)?.remove(
1093-
_itemKeys,
1094-
removeProperties(config, ['method', 'overwrite'])
1095-
);
1091+
this.getGroup(oldGroupKey)?.remove(_itemKeys, config);
10961092

10971093
// Assign itemKeys to new Group
10981094
this.getGroup(newGroupKey)?.add(_itemKeys, config);

packages/core/src/collection/group/group.observer.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
copy,
3-
defineConfig,
4-
equal,
5-
generateId,
6-
removeProperties,
7-
} from '@agile-ts/utils';
1+
import { copy, defineConfig, equal, generateId } from '@agile-ts/utils';
82
import {
93
CreateObserverConfigInterface,
104
CreateRuntimeJobConfigInterface,

packages/core/src/collection/group/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
defineConfig,
44
isValidObject,
55
normalizeArray,
6-
removeProperties,
76
} from '@agile-ts/utils';
87
import { logCodeManager } from '../../logCodeManager';
98
import {
@@ -197,7 +196,7 @@ export class Group<
197196
if (notExistingItemKeysInCollection.length >= _itemKeys.length)
198197
config.background = true;
199198

200-
this.set(newGroupValue, removeProperties(config, ['softRebuild']));
199+
this.set(newGroupValue, config);
201200

202201
return this;
203202
}
@@ -271,10 +270,7 @@ export class Group<
271270
)
272271
config.background = true;
273272

274-
this.set(
275-
newGroupValue,
276-
removeProperties(config, ['method', 'softRebuild'])
277-
);
273+
this.set(newGroupValue, config);
278274

279275
return this;
280276
}

packages/core/src/computed/computed.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
defineConfig,
3-
isAsyncFunction,
4-
removeProperties,
5-
} from '@agile-ts/utils';
1+
import { defineConfig, isAsyncFunction } from '@agile-ts/utils';
62
import { Agile } from '../agile';
73
import { extractRelevantObservers } from '../utils';
84
import {
@@ -103,10 +99,7 @@ export class Computed<ComputedValueType = any> extends State<
10399
autodetect: false,
104100
});
105101
this.compute({ autodetect: config.autodetect }).then((result) => {
106-
this.observers['value'].ingestValue(
107-
result,
108-
removeProperties(config, ['autodetect'])
109-
);
102+
this.observers['value'].ingestValue(result, config);
110103
});
111104
return this;
112105
}
@@ -157,7 +150,7 @@ export class Computed<ComputedValueType = any> extends State<
157150

158151
// Recompute to assign the new computed value to the Computed
159152
// and autodetect missing dependencies
160-
this.recompute(removeProperties(config, ['overwriteDeps']));
153+
this.recompute(config);
161154

162155
return this;
163156
}

packages/core/src/computed/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { removeProperties, defineConfig } from '@agile-ts/utils';
1+
import { defineConfig } from '@agile-ts/utils';
22
import { CreateAgileSubInstanceInterface, shared } from '../shared';
33
import {
44
Computed,
@@ -75,7 +75,7 @@ export function createComputed<ComputedValueType = any>(
7575
return new Computed<ComputedValueType>(
7676
_config.agileInstance as any,
7777
computeFunction,
78-
removeProperties(_config, ['agileInstance'])
78+
_config
7979
);
8080
}
8181

packages/core/src/runtime/observer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class Observer {
112112
* A dependent Observer is always ingested into the Runtime,
113113
* when the Observer it depends on has been ingested too.
114114
*
115-
* (Note: not mutating directly 'dependents' for better testing)
115+
* (Note: not mutating directly 'dependents' for better unit testing)
116116
*
117117
* @public
118118
* @param observer - Observer to depend on the Observer.
@@ -124,7 +124,7 @@ export class Observer {
124124
/**
125125
* Makes the specified Observer no longer depend on the Observer.
126126
*
127-
* (Note: not mutating directly 'dependents' for better testing)
127+
* (Note: not mutating directly 'dependents' for better unit testing)
128128
*
129129
* @public
130130
* @param observer - Observer to no longer depend on the Observer.

packages/core/src/runtime/subscription/sub.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig, isFunction, removeProperties } from '@agile-ts/utils';
1+
import { defineConfig, isFunction } from '@agile-ts/utils';
22
import { logCodeManager } from '../../logCodeManager';
33
import { Agile } from '../../agile';
44
import {
@@ -222,7 +222,7 @@ export class SubController {
222222
const componentSubscriptionContainer = new ComponentSubscriptionContainer(
223223
componentInstance,
224224
subs,
225-
removeProperties(config, ['waitForMount'])
225+
config
226226
);
227227
this.componentSubs.add(componentSubscriptionContainer);
228228

@@ -271,7 +271,7 @@ export class SubController {
271271
const callbackSubscriptionContainer = new CallbackSubscriptionContainer(
272272
callbackFunction,
273273
subs,
274-
removeProperties(config, ['waitForMount'])
274+
config
275275
);
276276
this.callbackSubs.add(callbackSubscriptionContainer);
277277
callbackSubscriptionContainer.ready = true;

packages/core/src/state/public/createEnhancedState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig, removeProperties } from '@agile-ts/utils';
1+
import { defineConfig } from '@agile-ts/utils';
22
import { shared } from '../../shared';
33
import { EnhancedState } from '../state.enhanced';
44
import { CreateStateConfigInterfaceWithAgile } from './index';
@@ -32,6 +32,6 @@ export function createEnhancedState<ValueType = any>(
3232
return new EnhancedState<ValueType>(
3333
config.agileInstance as any,
3434
initialValue,
35-
removeProperties(config, ['agileInstance'])
35+
config
3636
);
3737
}

0 commit comments

Comments
 (0)