@odoo/o-spreadsheet 19.1.0-alpha.8 → 19.1.0-alpha.9

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.
@@ -4107,8 +4107,17 @@ declare function isObjectEmptyRecursive<T extends object>(argument: T | undefine
4107
4107
  /**
4108
4108
  * Returns a function, that, as long as it continues to be invoked, will not
4109
4109
  * be triggered. The function will be called after it stops being called for
4110
- * N milliseconds. If `immediate` is passed, trigger the function on the
4111
- * leading edge, instead of the trailing.
4110
+ * N milliseconds. If `immediate` is passed, the function is called is called
4111
+ * immediately on the first call and the debouncing is triggered starting the second
4112
+ * call in the defined time window.
4113
+ *
4114
+ * Example:
4115
+ * debouncedFunction = debounce(() => console.log('Hello!'), 250);
4116
+ * debouncedFunction(); debouncedFunction(); // Will log 'Hello!' after 250ms
4117
+ *
4118
+ * debouncedFunction = debounce(() => console.log('Hello!'), 250, true);
4119
+ * debouncedFunction(); debouncedFunction(); // Will log 'Hello!' and relog it after 250ms
4120
+ *
4112
4121
  *
4113
4122
  * Also decorate the argument function with two methods: stopDebounce and isDebouncePending.
4114
4123
  *
@@ -3,8 +3,8 @@
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
5
  * @version 19.1.0-alpha.3
6
- * @date 2025-10-23T08:19:27.355Z
7
- * @hash 78717d4
6
+ * @date 2025-10-23T11:12:13.207Z
7
+ * @hash bd756dd
8
8
  */
9
9
 
10
10
  class FunctionCodeBuilder {
@@ -908,8 +908,17 @@ function isObjectEmptyRecursive(argument) {
908
908
  /**
909
909
  * Returns a function, that, as long as it continues to be invoked, will not
910
910
  * be triggered. The function will be called after it stops being called for
911
- * N milliseconds. If `immediate` is passed, trigger the function on the
912
- * leading edge, instead of the trailing.
911
+ * N milliseconds. If `immediate` is passed, the function is called is called
912
+ * immediately on the first call and the debouncing is triggered starting the second
913
+ * call in the defined time window.
914
+ *
915
+ * Example:
916
+ * debouncedFunction = debounce(() => console.log('Hello!'), 250);
917
+ * debouncedFunction(); debouncedFunction(); // Will log 'Hello!' after 250ms
918
+ *
919
+ * debouncedFunction = debounce(() => console.log('Hello!'), 250, true);
920
+ * debouncedFunction(); debouncedFunction(); // Will log 'Hello!' and relog it after 250ms
921
+ *
913
922
  *
914
923
  * Also decorate the argument function with two methods: stopDebounce and isDebouncePending.
915
924
  *
@@ -917,21 +926,21 @@ function isObjectEmptyRecursive(argument) {
917
926
  */
918
927
  function debounce(func, wait, immediate) {
919
928
  let timeout = undefined;
929
+ let firstCalled = false;
920
930
  const debounced = function () {
921
931
  const context = this;
922
932
  const args = Array.from(arguments);
933
+ if (!firstCalled && immediate) {
934
+ firstCalled = true;
935
+ return func.apply(context, args);
936
+ }
923
937
  function later() {
924
938
  timeout = undefined;
925
- if (!immediate) {
926
- func.apply(context, args);
927
- }
939
+ firstCalled = false;
940
+ func.apply(context, args);
928
941
  }
929
- const callNow = immediate && !timeout;
930
942
  clearTimeout(timeout);
931
943
  timeout = setTimeout(later, wait);
932
- if (callNow) {
933
- func.apply(context, args);
934
- }
935
944
  };
936
945
  debounced.isDebouncePending = () => timeout !== undefined;
937
946
  debounced.stopDebounce = () => {
@@ -50582,5 +50591,5 @@ export { BadExpressionError, BasePlugin, CellErrorType, CircularDependencyError,
50582
50591
 
50583
50592
 
50584
50593
  __info__.version = "19.1.0-alpha.3";
50585
- __info__.date = "2025-10-23T08:19:27.355Z";
50586
- __info__.hash = "78717d4";
50594
+ __info__.date = "2025-10-23T11:12:13.207Z";
50595
+ __info__.hash = "bd756dd";
@@ -3,8 +3,8 @@
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
5
  * @version 19.1.0-alpha.3
6
- * @date 2025-10-23T08:19:27.355Z
7
- * @hash 78717d4
6
+ * @date 2025-10-23T11:12:13.207Z
7
+ * @hash bd756dd
8
8
  */
9
9
 
10
10
  (function (exports) {
@@ -911,8 +911,17 @@
911
911
  /**
912
912
  * Returns a function, that, as long as it continues to be invoked, will not
913
913
  * be triggered. The function will be called after it stops being called for
914
- * N milliseconds. If `immediate` is passed, trigger the function on the
915
- * leading edge, instead of the trailing.
914
+ * N milliseconds. If `immediate` is passed, the function is called is called
915
+ * immediately on the first call and the debouncing is triggered starting the second
916
+ * call in the defined time window.
917
+ *
918
+ * Example:
919
+ * debouncedFunction = debounce(() => console.log('Hello!'), 250);
920
+ * debouncedFunction(); debouncedFunction(); // Will log 'Hello!' after 250ms
921
+ *
922
+ * debouncedFunction = debounce(() => console.log('Hello!'), 250, true);
923
+ * debouncedFunction(); debouncedFunction(); // Will log 'Hello!' and relog it after 250ms
924
+ *
916
925
  *
917
926
  * Also decorate the argument function with two methods: stopDebounce and isDebouncePending.
918
927
  *
@@ -920,21 +929,21 @@
920
929
  */
921
930
  function debounce(func, wait, immediate) {
922
931
  let timeout = undefined;
932
+ let firstCalled = false;
923
933
  const debounced = function () {
924
934
  const context = this;
925
935
  const args = Array.from(arguments);
936
+ if (!firstCalled && immediate) {
937
+ firstCalled = true;
938
+ return func.apply(context, args);
939
+ }
926
940
  function later() {
927
941
  timeout = undefined;
928
- if (!immediate) {
929
- func.apply(context, args);
930
- }
942
+ firstCalled = false;
943
+ func.apply(context, args);
931
944
  }
932
- const callNow = immediate && !timeout;
933
945
  clearTimeout(timeout);
934
946
  timeout = setTimeout(later, wait);
935
- if (callNow) {
936
- func.apply(context, args);
937
- }
938
947
  };
939
948
  debounced.isDebouncePending = () => timeout !== undefined;
940
949
  debounced.stopDebounce = () => {
@@ -50693,8 +50702,8 @@
50693
50702
 
50694
50703
 
50695
50704
  __info__.version = "19.1.0-alpha.3";
50696
- __info__.date = "2025-10-23T08:19:27.355Z";
50697
- __info__.hash = "78717d4";
50705
+ __info__.date = "2025-10-23T11:12:13.207Z";
50706
+ __info__.hash = "bd756dd";
50698
50707
 
50699
50708
 
50700
50709
  })(this.o_spreadsheet_engine = this.o_spreadsheet_engine || {});