@@ -182,7 +182,7 @@ export interface StorageMethodsInterface {
182
182
183
183
#### ` get `
184
184
185
- The get method of the storage. That means it gets items from the external storage.
185
+ The ` get ` method of the storage. That means it gets items from the external storage.
186
186
``` ts
187
187
myStorage .get (" item1" ); // Calls the here defined get method
188
188
```
@@ -195,7 +195,7 @@ myStorage.get("item1"); // Calls the here defined get method
195
195
196
196
#### ` set `
197
197
198
- The set method of the storage. This means that it writes items into the external storage.
198
+ The ` set ` method of the storage. This means that it writes items into the external storage.
199
199
``` ts
200
200
myStorage .set (" item1" , {my: " value" }); // Calls the here defined set method
201
201
```
@@ -208,7 +208,7 @@ myStorage.set("item1", {my: "value"}); // Calls the here defined set method
208
208
209
209
#### ` remove `
210
210
211
- The remove method from the storage. This means that it removes items from the external storage.
211
+ The ` remove ` method from the storage. This means that it removes items from the external storage.
212
212
``` ts
213
213
myStorage .remove (" item1" ); // Calls the here defined remove method
214
214
```
@@ -229,7 +229,7 @@ myStorage.remove("item1"); // Calls the here defined remove method
229
229
230
230
## ` StateIngestConfig `
231
231
232
- This is the ` StateIngestConfig ` Interface, and it is used as config object in function like ` set ` , ` undo ` , .. of a State.
232
+ This is the ` StateIngestConfig ` Interface, and it is used as configuration object in function like ` set() ` , ` undo() ` , ..
233
233
Here is a Typescript Interface of the Object for quick reference,
234
234
however each property will be explained in more detail below.
235
235
``` ts
@@ -366,7 +366,7 @@ Otherwise, it will be added to a que and performed whenever it is his turn.
366
366
367
367
## ` PatchConfig `
368
368
369
- This is the ` PatchConfig ` Interface, and it is used as config object in the ` patch ` function of a State.
369
+ This is the ` PatchConfig ` Interface, and it is used as configuration object in the ` patch() ` function of a State.
370
370
Here is a Typescript Interface of the Object for quick reference,
371
371
however each property will be explained in more detail below.
372
372
``` ts
@@ -406,7 +406,7 @@ MY_STATE.value; // Returns {id: 1, name: "frank", location: "Germany"}
406
406
407
407
## ` StatePersistentConfig `
408
408
409
- This is the ` StatePersistentConfig ` Interface, and it is used as config object in the ` persist ` function of a State.
409
+ This is the ` StatePersistentConfig ` Interface, and it is used as configuration object in the ` persist() ` function of a State.
410
410
Here is a Typescript Interface of the Object for quick reference,
411
411
however each property will be explained in more detail below.
412
412
``` ts
@@ -467,7 +467,7 @@ MY_STATE.persist({storageKeys: ['myCustomStorrage']}); // Stores value in 'myCus
467
467
468
468
## ` GroupConfig `
469
469
470
- This is the ` GroupConfig ` Interface, and it is used as config object in the creation of Groups.
470
+ This is the ` GroupConfig ` Interface, and it is used as configuration object in the creation of Groups.
471
471
Here is a Typescript Interface of the Object for quick reference,
472
472
however each property will be explained in more detail below.
473
473
``` ts
@@ -509,7 +509,7 @@ If Group is initially a Placeholder.
509
509
510
510
## ` SelectorConfig `
511
511
512
- This is the ` SelectorConfig ` Interface, and it is used as config object in the creation of Selectors.
512
+ This is the ` SelectorConfig ` Interface, and it is used as configuration object in the creation of Selectors.
513
513
Here is a Typescript Interface of the Object for quick reference,
514
514
however each property will be explained in more detail below.
515
515
``` ts
@@ -551,7 +551,7 @@ If Selector is initially a Placeholder.
551
551
552
552
## ` CollectConfig `
553
553
554
- This is the ` CollectConfig ` Interface, and it is used as config object in the ` collect ` method.
554
+ This is the ` CollectConfig ` Interface, and it is used as configuration object in the ` collect() ` method of a Collection .
555
555
Here is a Typescript Interface of the Object for quick reference,
556
556
however each property will be explained in more detail below.
557
557
``` ts
@@ -665,16 +665,18 @@ MY_COLLECTION.getSelector(1); // Returns Selector that got just created
665
665
666
666
## ` UpdateConfig `
667
667
668
- This is the ` UpdateConfig ` Interface, and it is used as config object in the ` update ` method. Here is a Typescript
669
- Interface of the Object for quick reference, however each property will be explained in more detail below.
670
-
668
+ This is the ` UpdateConfig ` Interface, and it is used as configuration object in the ` update() ` method.
669
+ Here is a Typescript Interface of the Object for quick reference,
670
+ however each property will be explained in more detail below.
671
671
``` ts
672
672
export interface UpdateConfigInterface {
673
673
patch? : boolean | { addNewProperties? : boolean };
674
674
background? : boolean ;
675
675
}
676
676
```
677
677
678
+ <br />
679
+
678
680
#### ` patch `
679
681
680
682
If the update data object should be merged into the existing data or overwrite it completely.
@@ -721,15 +723,17 @@ MY_COLLECTION.update(1, {name: "frank"}, {background: true});
721
723
722
724
## ` HasConfig `
723
725
724
- This is the ` HasConfig ` Interface, and it is used as config object in methods like ` hasGroup ` , ` hasSelector ` , .. Here is a Typescript
725
- Interface of the Object for quick reference, however each property will be explained in more detail below.
726
-
726
+ This is the ` HasConfig ` Interface, and it is used as configuration object in methods like ` hasGroup() ` , ` hasSelector() ` , ..
727
+ Here is a Typescript Interface of the Object for quick reference,
728
+ however each property will be explained in more detail below.
727
729
``` ts
728
730
export interface HasConfigInterface {
729
731
notExisting? : boolean ;
730
732
}
731
733
```
732
734
735
+ <br />
736
+
733
737
#### ` notExisting `
734
738
735
739
Should be set to ` true ` , if also not existing Instances should be returned, like ` placeholder ` Instances.
@@ -745,3 +749,164 @@ MY_COLLECTION.hasGroup('myPlaceholderGroup');
745
749
| Type | Default | Required |
746
750
| --------------------------| -----------| ----------|
747
751
| ` boolean ` | false | No |
752
+
753
+
754
+
755
+ <br />
756
+
757
+ ---
758
+
759
+ <br />
760
+
761
+
762
+
763
+ ## ` AddSideEffectConfig `
764
+
765
+ This is the ` AddSideEffectConfig ` Interface, and it is used as configuration object in the ` addSideEffect() ` method.
766
+ Here is a Typescript Interface of the Object for quick reference,
767
+ however each property will be explained in more detail below.
768
+ ``` ts
769
+ export interface AddSideEffectConfigInterface {
770
+ weight? : number ;
771
+ }
772
+ ```
773
+
774
+ <br />
775
+
776
+ #### ` weight `
777
+
778
+ Determines when the ` sideEffect ` callback should be executed,
779
+ since some ` sideEffects ` has to be executed before others.
780
+ The higher the ` weigth ` the earlier the ` sideEffect ` is executed.
781
+
782
+ ``` ts {3}
783
+ MY_STATE .addSideEffect (' mySideEffect' , (state , config ) => {
784
+ // sideEffect callback
785
+ }, {weigth: 10 });
786
+ ```
787
+
788
+
789
+ | Type | Default | Required |
790
+ | --------------------------| -----------| ----------|
791
+ | ` number ` | 10 | No |
792
+
793
+
794
+
795
+ <br />
796
+
797
+ ---
798
+
799
+ <br />
800
+
801
+
802
+
803
+ ## ` GroupAddConfig `
804
+
805
+ This is the ` GroupAddConfig ` Interface, and it is used as configuration object in functions like ` put() ` or ` add() ` .
806
+ Here is a Typescript Interface of the Object for quick reference,
807
+ however each property will be explained in more detail below.
808
+ ``` ts
809
+ export interface GroupAddConfig {
810
+ method? : ' unshift' | ' push' ;
811
+ overwrite? : boolean ;
812
+ background? : boolean ;
813
+ }
814
+ ```
815
+
816
+ <br />
817
+
818
+ #### ` method `
819
+
820
+ Defines which way the ` itemKey ` is added to the Group.
821
+ - ` unshift ` adds the ` itemKey ` at the beginning of the array
822
+ - ` push ` adds the ` itemKey ` at the end of the array
823
+
824
+ ``` ts
825
+ const MY_GROUP = MY_COLLECTION .createGroup (' group1' , [1 , 2 , 5 , 6 ]);
826
+ MY_GROUP .add (3 , {method: ' push' }); // Group value is '[1, 2, 5, 6, 3]'
827
+ MY_GROUP .add (9 , {method: ' unshift' }); // Group value is '[9, 1, 2, 5, 6, 3]'
828
+ ```
829
+
830
+ | Type | Default | Required |
831
+ | --------------------------| -----------| ----------|
832
+ | ` 'unshift' \| 'push' ` | 'push' | No |
833
+
834
+ <br />
835
+
836
+ #### ` overwrite `
837
+
838
+ If we add an ` itemKey ` twice to the Group,
839
+ it normally doesn't do anything, since the ` itemKey ` already exists.
840
+ ``` ts
841
+ const MY_GROUP = MY_COLLECTION .createGroup (' group1' , [1 , 2 , 5 , 6 ]);
842
+ MY_GROUP .add (2 ); // Group value is '[1, 2, 5, 6]'
843
+ ```
844
+ By overwriting the ` itemKey ` it simply removes the old ` itemKey ` and adds it again.
845
+ ``` ts
846
+ const MY_GROUP = MY_COLLECTION .createGroup (' group1' , [1 , 2 , 5 , 6 ]);
847
+ MY_GROUP .add (2 , {overwrite: true }); // Group value is '[1, 5, 6, 2]'
848
+ ```
849
+
850
+ | Type | Default | Required |
851
+ | --------------------------| -----------| ----------|
852
+ | ` boolean ` | false | No |
853
+
854
+ <br />
855
+
856
+ #### ` background `
857
+
858
+ Sometimes we want to add ` itemKes ` to our Group in background, so that no component rerender that has bound the
859
+ Group to itself. Then this property might get handy.
860
+
861
+ ``` ts {5}
862
+ // Causes rerender on Components
863
+ MY_GROUP .add (1 );
864
+
865
+ // Doesn't cause rerender on Comonents
866
+ MY_GROUP .add (1 , {background: true });
867
+ ```
868
+
869
+ | Type | Default | Required |
870
+ | --------------------------| -----------| ----------|
871
+ | ` boolean ` | false | No |
872
+
873
+
874
+
875
+ <br />
876
+
877
+ ---
878
+
879
+ <br />
880
+
881
+
882
+
883
+ ## ` UpdateItemKeyConfig `
884
+
885
+ This is the ` UpdateItemKeyConfig ` Interface, and it is used as configuration object the ` updateItemKey ` function.
886
+ Here is a Typescript Interface of the Object for quick reference,
887
+ however each property will be explained in more detail below.
888
+ ``` ts
889
+ export interface UpdateItemKeyConfigInterface {
890
+ background? : boolean ;
891
+ }
892
+ ```
893
+
894
+ <br />
895
+
896
+ #### ` background `
897
+
898
+ Sometimes we want to update a ` itemKes ` in background, so that no component rerender that has bound the
899
+ Collection to itself. Then this property might get handy.
900
+
901
+ ``` ts {5}
902
+ // Causes rerender on Components
903
+ MY_COLLECTION .updateItemKey (1 , 3 );
904
+
905
+ // Doesn't cause rerender on Comonents
906
+ MY_COLLECTION .updateItemKey (1 , 3 , {background: true });
907
+ ```
908
+
909
+ | Type | Default | Required |
910
+ | --------------------------| -----------| ----------|
911
+ | ` boolean ` | false | No |
912
+
0 commit comments