vscroll 1.4.4 → 1.5.2

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.
Files changed (82) hide show
  1. package/README.md +92 -46
  2. package/dist/bundles/vscroll.esm5.js +107 -83
  3. package/dist/bundles/vscroll.esm5.js.map +1 -1
  4. package/dist/bundles/vscroll.esm5.min.js +2 -2
  5. package/dist/bundles/vscroll.esm5.min.js.map +1 -1
  6. package/dist/bundles/vscroll.esm6.js +25 -16
  7. package/dist/bundles/vscroll.esm6.js.map +1 -1
  8. package/dist/bundles/vscroll.esm6.min.js +2 -2
  9. package/dist/bundles/vscroll.esm6.min.js.map +1 -1
  10. package/dist/bundles/vscroll.umd.js +108 -84
  11. package/dist/bundles/vscroll.umd.js.map +1 -1
  12. package/dist/bundles/vscroll.umd.min.js +2 -2
  13. package/dist/bundles/vscroll.umd.min.js.map +1 -1
  14. package/dist/esm2015/classes/adapter.js +2 -2
  15. package/dist/esm2015/classes/adapter.js.map +1 -1
  16. package/dist/esm2015/classes/buffer.js +2 -6
  17. package/dist/esm2015/classes/buffer.js.map +1 -1
  18. package/dist/esm2015/classes/domRoutines.js +13 -2
  19. package/dist/esm2015/classes/domRoutines.js.map +1 -1
  20. package/dist/esm2015/classes/logger.js.map +1 -1
  21. package/dist/esm2015/index.js.map +1 -1
  22. package/dist/esm2015/interfaces/index.js.map +1 -1
  23. package/dist/esm2015/interfaces/routines.js.map +1 -1
  24. package/dist/esm2015/interfaces/workflow.js.map +1 -1
  25. package/dist/esm2015/scroller.js +2 -2
  26. package/dist/esm2015/scroller.js.map +1 -1
  27. package/dist/esm2015/version.js +1 -1
  28. package/dist/esm2015/version.js.map +1 -1
  29. package/dist/esm2015/workflow.js +4 -2
  30. package/dist/esm2015/workflow.js.map +1 -1
  31. package/dist/esm5/classes/adapter.js +6 -6
  32. package/dist/esm5/classes/adapter.js.map +1 -1
  33. package/dist/esm5/classes/buffer/cache.js +1 -1
  34. package/dist/esm5/classes/buffer/cache.js.map +1 -1
  35. package/dist/esm5/classes/buffer/checkCall.js +4 -4
  36. package/dist/esm5/classes/buffer/checkCall.js.map +1 -1
  37. package/dist/esm5/classes/buffer.js +5 -9
  38. package/dist/esm5/classes/buffer.js.map +1 -1
  39. package/dist/esm5/classes/domRoutines.js +27 -5
  40. package/dist/esm5/classes/domRoutines.js.map +1 -1
  41. package/dist/esm5/classes/logger.js +19 -19
  42. package/dist/esm5/classes/logger.js.map +1 -1
  43. package/dist/esm5/classes/state/cycle.js +2 -2
  44. package/dist/esm5/classes/state/cycle.js.map +1 -1
  45. package/dist/esm5/classes/viewport.js +1 -1
  46. package/dist/esm5/classes/viewport.js.map +1 -1
  47. package/dist/esm5/index.js.map +1 -1
  48. package/dist/esm5/inputs/validation.js +4 -4
  49. package/dist/esm5/inputs/validation.js.map +1 -1
  50. package/dist/esm5/interfaces/index.js.map +1 -1
  51. package/dist/esm5/interfaces/routines.js.map +1 -1
  52. package/dist/esm5/interfaces/workflow.js.map +1 -1
  53. package/dist/esm5/processes/adapter/remove.js +1 -1
  54. package/dist/esm5/processes/adapter/remove.js.map +1 -1
  55. package/dist/esm5/processes/adjust.js +5 -5
  56. package/dist/esm5/processes/adjust.js.map +1 -1
  57. package/dist/esm5/processes/clip.js +5 -5
  58. package/dist/esm5/processes/clip.js.map +1 -1
  59. package/dist/esm5/processes/fetch.js +2 -2
  60. package/dist/esm5/processes/fetch.js.map +1 -1
  61. package/dist/esm5/processes/misc/base.js +1 -1
  62. package/dist/esm5/processes/misc/base.js.map +1 -1
  63. package/dist/esm5/processes/preClip.js +2 -2
  64. package/dist/esm5/processes/preClip.js.map +1 -1
  65. package/dist/esm5/processes/preFetch.js +5 -5
  66. package/dist/esm5/processes/preFetch.js.map +1 -1
  67. package/dist/esm5/processes/scroll.js +2 -2
  68. package/dist/esm5/processes/scroll.js.map +1 -1
  69. package/dist/esm5/scroller.js +3 -3
  70. package/dist/esm5/scroller.js.map +1 -1
  71. package/dist/esm5/version.js +1 -1
  72. package/dist/esm5/version.js.map +1 -1
  73. package/dist/esm5/workflow.js +10 -4
  74. package/dist/esm5/workflow.js.map +1 -1
  75. package/dist/typings/classes/domRoutines.d.ts +2 -2
  76. package/dist/typings/index.d.ts +2 -2
  77. package/dist/typings/interfaces/index.d.ts +2 -2
  78. package/dist/typings/interfaces/routines.d.ts +3 -0
  79. package/dist/typings/interfaces/workflow.d.ts +3 -0
  80. package/dist/typings/scroller.d.ts +1 -1
  81. package/dist/typings/workflow.d.ts +1 -1
  82. package/package.json +18 -17
package/README.md CHANGED
@@ -3,6 +3,20 @@
3
3
 
4
4
  # VScroll
5
5
 
6
+ - [Overview](#overview)
7
+ - [Getting started](#getting-started)
8
+ - [Usage](#usage)
9
+ - [Consumer](#1-consumer)
10
+ - [Element](#2-element)
11
+ - [Datasource](#3-datasource)
12
+ - [Run](#4-run)
13
+ - [Routines](#5-routines)
14
+ - [Live](#live)
15
+ - [Adapter API](#adapter-api)
16
+ - [Thanks](#thanks)
17
+
18
+ ## Overview
19
+
6
20
  VScroll is a JavaScript library providing virtual scroll engine. Can be seen as a core for platform-specific solutions designed to represent unlimited datasets using virtualization technique. Below is the diagram of how the VScroll engine is being distributed to the end user.
7
21
 
8
22
  <br>
@@ -10,10 +24,11 @@ VScroll is a JavaScript library providing virtual scroll engine. Can be seen as
10
24
  <img src="https://user-images.githubusercontent.com/4365660/104845671-ad1d4b80-58e7-11eb-9cc9-4a00ebcbc9e8.png">
11
25
  </p>
12
26
 
13
- Basically, the consumer layer can be omitted and the end Application developers can use VScroll directly. Currently there exist two consumer implementations built on top of VScroll:
27
+ Basically, the consumer layer can be omitted and the end Application developers can use VScroll directly. This repository has a [minimal demo page](https://dhilt.github.io/vscroll/) of direct use of the VScroll library in a non-specific environment. There are also several consumer implementations built on top of VScroll:
14
28
 
15
29
  - [ngx-ui-scroll](https://github.com/dhilt/ngx-ui-scroll), Angular virtual scroll directive
16
30
  - [vscroll-native](https://github.com/dhilt/vscroll-native), virtual scroll module for native JavaScript applications
31
+ - [Vue integration sample](https://stackblitz.com/edit/vscroll-vue-integration?file=src%2Fcomponents%2FVScroll.vue), very rough implementation for Vue
17
32
 
18
33
  ## Getting started
19
34
 
@@ -22,7 +37,7 @@ Basically, the consumer layer can be omitted and the end Application developers
22
37
  ```html
23
38
  <script src="https://cdn.jsdelivr.net/npm/vscroll"></script>
24
39
  <script>
25
- const workflow = new VScroll.Workflow({...});
40
+ const workflow = new VScroll.Workflow(...);
26
41
  </script>
27
42
  ```
28
43
 
@@ -35,12 +50,18 @@ npm install vscroll
35
50
  ```js
36
51
  import { Workflow } from 'vscroll';
37
52
 
38
- const workflow = new Workflow({...});
53
+ const workflow = new Workflow(...);
39
54
  ```
40
55
 
41
56
  ## Usage
42
57
 
43
- The main entity distributed via `vscroll` is the `Workflow` class. Its instantiating runs the virtual scroll engine. The constructor of the `Workflow` class requires an argument of the following type:
58
+ The main entity distributed via `vscroll` is the `Workflow` class. Its instantiating runs the virtual scroll engine.
59
+
60
+ ```js
61
+ new Workflow({ consumer, element, datasource, run });
62
+ ```
63
+
64
+ The constructor of the `Workflow` class requires an argument of the following type:
44
65
 
45
66
  ```typescript
46
67
  interface WorkflowParams<ItemData> {
@@ -48,6 +69,7 @@ interface WorkflowParams<ItemData> {
48
69
  element: HTMLElement;
49
70
  datasource: IDatasource<ItemData>;
50
71
  run: OnDataChanged<ItemData>;
72
+ Routines?: CustomRoutinesClass;
51
73
  }
52
74
  ```
53
75
 
@@ -58,10 +80,10 @@ This is a TypeScript definition, but speaking of JavaScript, an argument object
58
80
  A simple data object that provides information about a consumer. It is not critical to omit this, but if the result solution is going to be published as a separate 3d-party library ("consumer"), the name and the version of the result package should be passed as follows:
59
81
 
60
82
  ```js
61
- consumer: {
83
+ const consumer = {
62
84
  name: 'my-vscroll-consumer',
63
85
  version: 'v1.0.0-alpha.1'
64
- },
86
+ };
65
87
  ```
66
88
 
67
89
  ### 2. Element
@@ -69,7 +91,7 @@ consumer: {
69
91
  An HTML element the `Workflow` should use as a scrollable part of the viewport. It should be present in DOM before instantiating the `Workflow`.
70
92
 
71
93
  ```js
72
- element: document.getElementById('vscroll'),
94
+ const element = document.getElementById('vscroll');
73
95
  ```
74
96
 
75
97
  This element should be wrapped with another container with constrained height and overflow scroll/auto. And it also must have two special padding elements marked with special attributes for the virtualization purpose.
@@ -92,48 +114,39 @@ This element should be wrapped with another container with constrained height an
92
114
 
93
115
  ### 3. Datasource
94
116
 
95
- This is a special object, providing dataset items in runtime. Basically, a consumer app should expose a Datasource factory to be used by the end App, but in the simplest case it can be defined as follows:
117
+ This is a special object, providing dataset items in runtime. There is a separate wiki document describing the Datasource: [github.com/dhilt/vscroll/wiki/Datasource](https://github.com/dhilt/vscroll/wiki/Datasource). Below is a short version.
118
+
119
+ The Datasource can be defined in two ways. First, as an object literal:
96
120
 
97
121
  ```js
98
- datasource: {
122
+ const datasource = {
99
123
  get: (index, count, success) => {
100
124
  const data = [];
101
- for (let i = index; i <= index + count - 1; i++) {
125
+ for (let i = index; i < index + count; i++) {
102
126
  data.push({ id: i, text: 'item #' + i });
103
127
  }
104
128
  success(data);
105
129
  }
106
- },
130
+ };
107
131
  ```
108
132
 
109
- The `Workflow` will request data via `get` method. This particular Datasource sample implements an unlimited synchronous stream of data generated in runtime, but depends on the end App needs it can be limited or partially limited, asynchronous, index-inverted, powered with cache, Promise- or even Observable-based (instead of Callback-based) etc.
110
-
111
- Along with the `Workflow`, VScroll exposes method `makeDatasource` which can be used for creating Datasource factory, so the end Datasource might be instantiated via operator `new`:
133
+ Second, as an instance of Datasource class which can be obtained through a special factory method. Along with the `Workflow` class, VScroll exposes the `makeDatasource` method which can be used for creating Datasource class, so the end datasource object can be instantiated via operator `new`:
112
134
 
113
135
  ```js
114
- const Datasource = VScroll.makeDatasource();
115
- ...
116
- datasource: new Datasource({
117
- get: (index, count, success) => ...
118
- }),
136
+ import { makeDatasource } from 'vscroll';
137
+ const Datasource = makeDatasource();
138
+
139
+ const datasource = new Datasource({
140
+ get: (index, length, success) =>
141
+ success(Array.from({ length }).map((_, i) =>
142
+ ({ id: index + i, text: 'item #' + (index + i) })
143
+ ))
144
+ });
119
145
  ```
120
146
 
121
- This option also makes the [Adapter API](#adapter-api) available via `datasource.adapter` property after the Datasource is instantiated. It provides massive functionality to assess and manipulate Scroller's data at runtime.
147
+ The argument of the Datasource class is the same object literal as in the first case. It has one mandatory field which is the core of the App-Scroller integration: method `get`. The `Workflow` requests data via the `Datasource.get` method in runtime.
122
148
 
123
- Using TypeScript, the above example should be written as follows:
124
-
125
- ```typescript
126
- interface Data {
127
- id: number;
128
- text: string;
129
- ...
130
- }
131
-
132
- const Datasource = VScroll.makeDatasource();
133
- const datasource = new Datasource<Data>(...);
134
- ```
135
-
136
- This obliges the Datasource.get method to deal with _Data_ items and also provides strong typing for Adapter API props and methods.
149
+ For more solid understanding the concept of the Datasource with examples, please, refer to [the Datasource doc](https://github.com/dhilt/vscroll/wiki/Datasource).
137
150
 
138
151
  ### 4. Run
139
152
 
@@ -151,15 +164,15 @@ run: (newItems) => {
151
164
  };
152
165
  ```
153
166
 
154
- Each item (in both `newItems` and `oldItems` lists) is an instance of the [Item class](https://github.com/dhilt/vscroll/blob/v1.0.0/src/classes/item.ts) implementing the [Item interface](https://github.com/dhilt/vscroll/blob/v1.0.0/src/interfaces/item.ts), whose props can be used for proper implementation of the `run` callback:
167
+ Each item (in both `newItems` and `oldItems` lists) is an instance of the [Item class](https://github.com/dhilt/vscroll/blob/v1.5.0/src/classes/item.ts) implementing the [Item interface](https://github.com/dhilt/vscroll/blob/v1.5.0/src/interfaces/item.ts), whose props can be used for proper implementation of the `run` callback:
155
168
 
156
169
  |Name|Type|Description|
157
170
  |:--|:--|:----|
158
171
  |element|_HTMLElement_|HTML element associated with the item|
159
172
  |$index|_number_|Integer index of the item in the Datasource. Correlates with the first argument of the Datasource.get method|
160
173
  |data|_Data_|Data (contents) of the item. This is what the Datasource.get passes to the Scroller via success-callback as an array of data-items typed as Data[]|
161
- |invisible|_boolean_|A flag that determines whether the item should be hidden (if _true_) or visible (if _false_) when the _run_ method is called|
162
- |get|_()&nbsp;=>&nbsp;ItemAdapter&lt;Data&gt;_|A shortcut method returning { element, $index, data } object|
174
+ |invisible|_boolean_|Flag that determines whether the item should be hidden (if _true_) or visible (if _false_) when the _run_ method is called|
175
+ |get|_()&nbsp;=>&nbsp;ItemAdapter&lt;Data&gt;_|Shortcut method returning { element, $index, data } object|
163
176
 
164
177
  `Run` callback is the most complex and environment-specific part of the `vscroll` API, which is fully depends on the environment for which the consumer is being created. Framework specific consumer should rely on internal mechanism of the framework to provide runtime DOM modifications.
165
178
 
@@ -168,18 +181,49 @@ There are some requirements on how the items should be processed by `run` call:
168
181
  - old items that are not in the new item list should be removed from DOM; use `oldItems[].element` references for this purpose;
169
182
  - old items that are in the list should not be removed and recreated, as it may lead to an unwanted shift of the scroll position; just don't touch them;
170
183
  - new items elements should be rendered in accordance with `newItems[].$index` comparable to `$index` of elements that remain: `$index` must increase continuously and the directions of increase must persist across the `run` calls; Scroller maintains `$index` internally, so you only need to properly inject a set of `newItems[].element` into the DOM;
171
- - new elements should be rendered but not visible, and this should be achieved by "fixed" positioning and "left"/"top" coordinates placing the item element out of view; the Workflow will take care of visibility after calculations; an additional attribute `newItems[].invisible` can be used to determine if a given element should be hidden;
172
- - new items elements should have "data-sid" attribute, which value should reflect `newItems[].$index`;
184
+ - new elements should be rendered but not visible, and this should be achieved by "fixed" positioning and "left"/"top" coordinates placing the item element out of view; the Workflow will take care of visibility after calculations; an additional attribute `newItems[].invisible` can be used to determine if a given element should be hidden; this requirement can be changed by the `Routines` class setting, see below;
185
+ - new items elements should have "data-sid" attribute, which value should reflect `newItems[].$index`.
186
+
187
+ ### 5. Routines
188
+
189
+ A special class allowing to override the default behavior related to the DOM. All DOM-specific operations are implemented as the [DOM Routines class](https://github.com/dhilt/vscroll/blob/v1.5.0/src/classes/domRoutines.ts) methods inside core. When the `Routines` class setting is passed among the Workflow arguments, its methods override the base class methods. The Routines methods description can be taken from the [IRoutines interface](https://github.com/dhilt/vscroll/blob/v1.5.0/src/interfaces/routines.ts) sources. For example, there is a method that throws an error if its argument is not an HTML element:
190
+
191
+ ```typescript
192
+ checkElement(element: HTMLElement): void {
193
+ if (!element) {
194
+ throw new Error('HTML element is not defined');
195
+ }
196
+ }
197
+ ```
198
+
199
+ With the `Routines` class setting it can be overridden as follows:
200
+
201
+ ```js
202
+ new Workflow({
203
+ consumer, element, datasource, run,
204
+ Routines: class {
205
+ checkElement(element) {
206
+ if (!element || typeof element.querySelector !== 'function') {
207
+ throw new Error('Fatal: expecting HTML element');
208
+ }
209
+ }
210
+ }
211
+ });
212
+ ```
213
+
214
+ Various DOM calculations, setting/getting the scroll position, render process and other logic can be adjusted, improved or completely replaced by custom methods of the `Routines` class setting.
173
215
 
174
216
  ## Live
175
217
 
176
- This repository has a minimal demonstration of the App-consumer implementation considering all of the requirements listed above: https://dhilt.github.io/vscroll/. This is all-in-one HTML demo with `vscroll` taken from CDN. The source code of the demo is [here](https://github.com/dhilt/vscroll/blob/main/demo/index.html). The approach is rough and non-optimized, if you are seeking for more general solution for native JavaScript applications, please take a look at [vscroll-native](https://github.com/dhilt/vscroll-native) project. It is relatively new and has no good documentation, but its [source code](https://github.com/dhilt/vscroll-native/tree/main/src) and [demo](https://github.com/dhilt/vscroll-native/tree/main/demo) may shed light on `vscroll` usage in no-framework environment.
218
+ This repository has a minimal demonstration of the App-consumer implementation considering all of the requirements listed above: https://dhilt.github.io/vscroll/. This is all-in-one HTML demo with `vscroll` taken from CDN. The source code of the demo is [here](https://github.com/dhilt/vscroll/blob/main/demo/index.html). The approach is rough and non-optimized, if you are seeking for more general solution for native JavaScript applications, please have a look at [vscroll-native](https://github.com/dhilt/vscroll-native) project. It is relatively new and has no good documentation, but its [source code](https://github.com/dhilt/vscroll-native/tree/main/src) and its [demo](https://github.com/dhilt/vscroll-native/tree/main/demo) may shed light on `vscroll` usage in no-framework environment.
177
219
 
178
- Another example is [ngx-ui-scroll](https://github.com/dhilt/ngx-ui-scroll). Before 2021 `vscroll` was part of `ngx-ui-scroll`, and its [demo page](https://dhilt.github.io/ngx-ui-scroll/#/) contains well-documented samples that can be used to get an idea on the API and functionality offered by `vscroll`. The code of the [UiScrollComponent](https://github.com/dhilt/ngx-ui-scroll/blob/v2.2.0/src/ui-scroll.component.ts) clearly demonstrates the `Workflow` instantiation in the context of Angular. Also, since ngx-ui-scroll is the intermediate layer between `vscroll` and the end Application, the Datasource is being provided from the outside. Method `makeDatasource` is used to provide `Datasource` class to the end Application.
220
+ Another example is [ngx-ui-scroll](https://github.com/dhilt/ngx-ui-scroll). Before 2021 `vscroll` was part of `ngx-ui-scroll`, and its [demo page](https://dhilt.github.io/ngx-ui-scroll/#/) contains well-documented samples that can be used to get an idea on the API and functionality offered by `vscroll`. The code of the [UiScrollComponent](https://github.com/dhilt/ngx-ui-scroll/blob/v2.3.1/src/ui-scroll.component.ts) clearly demonstrates the `Workflow` instantiation in the context of Angular. Also, since ngx-ui-scroll is the intermediate layer between `vscroll` and the end Application, the Datasource is being provided from the outside. Method `makeDatasource` is used to provide `Datasource` class to the end Application.
179
221
 
180
222
  ## Adapter API
181
223
 
182
- Adapter API is a powerful feature of the `vscroll` engine. Please refer to ngx-ui-scroll [Adapter API doc](https://github.com/dhilt/ngx-ui-scroll#adapter-api) as it can be applied to `vscroll` case with only one important difference: vscroll does not have RxJs entities, it has [Reactive](https://github.com/dhilt/vscroll/blob/main/src/classes/reactive.ts) ones instead. It means, for example, `eof$` has no "subscribe" method, but "on":
224
+ Adapter API is a powerful feature of the `vscroll` engine allowing to collect the statistics and provide runtime manipulations with the viewport: adding, removing, updating items. This API is very useful when building the real-time interactive applications when data can change over time by not only scrolling (like chats).
225
+
226
+ Please refer to the ngx-ui-scroll [Adapter API doc](https://github.com/dhilt/ngx-ui-scroll#adapter-api) as it can be applied to `vscroll` case with only one important difference: vscroll does not have RxJs entities, it has [Reactive](https://github.com/dhilt/vscroll/blob/main/src/classes/reactive.ts) ones instead. It means, for example, `eof$` has no "subscribe" method, but "on":
183
227
 
184
228
  ```js
185
229
  // ngx-ui-scroll
@@ -192,16 +236,16 @@ myDatasource.adapter.bof$.on(value =>
192
236
  );
193
237
  ```
194
238
 
195
- Adapter API becomes available as `Datasource.adapter` property after the Datasource is instantiated via operator "new". In terms of "vscroll" you need to get a Datasource class by calling `makeDatasource` method, then you can instantiate it. `makeDatasource` accepts 1 argument, which is an Adapter custom configuration. Currently this config can only be used to redefine the just mentioned Adapter reactive props. Here's an example of how simple Reactive props can be overridden with RxJs Subject and BehaviorSubject entities: [ui-scroll.datasource.ts](https://github.com/dhilt/ngx-ui-scroll/blob/v2.2.0/src/ui-scroll.datasource.ts).
239
+ Adapter API becomes available as the `Datasource.adapter` property after the Datasource is instantiated via operator "new". In terms of "vscroll" you need to get a Datasource class by calling the `makeDatasource` method, then you can instantiate it. `makeDatasource` accepts 1 argument, which is an Adapter custom configuration. Currently this config can only be used to redefine the just mentioned Adapter reactive props. Here's an example of how simple Reactive props can be overridden with RxJs Subject and BehaviorSubject entities: [ui-scroll.datasource.ts](https://github.com/dhilt/ngx-ui-scroll/blob/v2.3.1/src/ui-scroll.datasource.ts).
196
240
 
197
- An important note is that the Adapter getting ready breaks onto 2 parts: instantiation (which is synchronous with the Datasource instantiation) and initialization (which occurs during the Workflow instantiating). Adapter gets all necessary props and methods during the first phase, but this starts work only when the second phase is done. Practically this means
241
+ An important note is that the Adapter getting ready breaks onto 2 parts: instantiation (which is synchronous with the Datasource instantiation) and initialization (which occurs during the Workflow instantiating). Adapter gets all necessary props and methods during the first phase, but they start work only when the second phase is done. Practically this means
198
242
  - you may arrange any Adapter reactive subscriptions in your app/consumer right after the Datasource is instantiated,
199
243
  - some of the initial (default) values can be unusable, like `Adapter.bufferInfo.minIndex` = NaN (because Scroller's Buffer is empty before the very first `Datasource.get` call),
200
244
  - Adapter methods do nothing when called before phase 2, they immediately resolve some default "good" value (`{ immediate: true, success: true, ... }`).
201
245
 
202
246
  If there is some logic that could potentially run before the Adapter initialization and you don't want this to happen, the following approach can be applied:
203
247
 
204
- ```
248
+ ```js
205
249
  myDatasource = new VScroll.makeDatasource()({...});
206
250
  myDatasource.adapter.init$.once(() => {
207
251
  console.log('The Adapter is initialized'); // 2nd output
@@ -218,7 +262,9 @@ VScroll will receive its own Adapter API documentation later, but for now please
218
262
 
219
263
  \- to [Joshua Toenyes](https://github.com/JoshuaToenyes) as he transferred ownership to the "vscroll" npm repository which he owned but did not use,
220
264
 
221
- \- to all contributors of related repositories ([link](https://github.com/angular-ui/ui-scroll/graphs/contributors), [link](https://github.com/dhilt/ngx-ui-scroll/graphs/contributors)).
265
+ \- to all contributors of related repositories ([link](https://github.com/angular-ui/ui-scroll/graphs/contributors), [link](https://github.com/dhilt/ngx-ui-scroll/graphs/contributors)),
266
+
267
+ \- to all donators as their great support does increase motivation.
222
268
 
223
269
  <br>
224
270