@azrico/global 1.3.83 → 1.3.85
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.
|
@@ -24,14 +24,14 @@ export declare function clear_all_filters(): any;
|
|
|
24
24
|
* @param initialValue
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
export declare function apply_filter(key: string, initialValue?: any
|
|
27
|
+
export declare function apply_filter(key: string, initialValue?: any): Promise<any>;
|
|
28
28
|
/**
|
|
29
29
|
* Apply a filter synchronously
|
|
30
30
|
* @param key
|
|
31
31
|
* @param initialValue
|
|
32
32
|
* @returns
|
|
33
33
|
*/
|
|
34
|
-
export declare function apply_filter_sync(key: string, initialValue?: any
|
|
34
|
+
export declare function apply_filter_sync(key: string, initialValue?: any): any;
|
|
35
35
|
/**
|
|
36
36
|
* Adds a filter until the current component unmounts
|
|
37
37
|
* @param key
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
* @param key
|
|
21
21
|
* @param initialValue
|
|
22
22
|
* @returns
|
|
23
|
-
*/function _apply_filter(){return _apply_filter=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,i
|
|
23
|
+
*/function _apply_filter(){return _apply_filter=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,i=arguments;return _regeneratorRuntime().wrap(function j(b){for(;1;)switch(b.prev=b.next){case 0:if(c=1<i.length&&void 0!==i[1]?i[1]:null,d=_core["default"].Global_get(lname_filter,a),Array.isArray(d)&&0!=d.length){b.next=4;break}return b.abrupt("return",c);case 4:d.sort(function(c,a){return c.order>a.order?1:-1}),e=c,f=0;case 7:if(!(f<d.length)){b.next=16;break}return g=d[f],b.next=11,g.action(e);case 11:h=b.sent,e=h;case 13:f++,b.next=7;break;case 16:return b.abrupt("return",e);case 17:case"end":return b.stop()}},b)})),_apply_filter.apply(this,arguments)}function apply_filter_sync(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,c=_core["default"].Global_get(lname_filter,a);if(!Array.isArray(c)||0==c.length)return b;c.sort(function(c,a){return c.order>a.order?1:-1});/* lower order gets executed first */for(var d=b,e=0;e<c.length;e++){var f=c[e],g=f.action(d);// if (logs) console.log("[filtered]", previous_value, " --> ", new_value);
|
|
24
|
+
g!==void 0&&(d=g)}return d}/* -------------------------------------------------------------------------- */ /**
|
|
24
25
|
* Adds a filter until the current component unmounts
|
|
25
26
|
* @param key
|
|
26
27
|
* @param action
|