@pogodisco/zephyr 1.3.1 → 1.3.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.
package/dist/utils.d.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  type AnyFn = (...args: any[]) => any;
2
2
  /**
3
- * For generic actions where you want to specify the return type
4
- * Just a type helper, does nothing at runtime
3
+ * For generic actions - preserves the generic parameter
5
4
  */
6
- export declare function genericAction<F extends AnyFn>(fn: F): <T = ReturnType<F>>() => ((...args: Parameters<F>) => T);
5
+ export declare function genericAction<F extends AnyFn>(fn: F): <T>() => ((...args: Parameters<F>) => ReturnType<F>);
7
6
  /**
8
- * For fixed actions - just returns the function
9
- * The type parameter T is for convenience when you want to override the return type
7
+ * For fixed actions
10
8
  */
11
- export declare function fixedAction<F extends AnyFn>(fn: F): <T = ReturnType<F>>() => ((...args: Parameters<F>) => T);
9
+ export declare function fixedAction<F extends AnyFn>(fn: F): () => ((...args: Parameters<F>) => ReturnType<F>);
12
10
  export {};
package/dist/utils.js CHANGED
@@ -40,16 +40,19 @@
40
40
  // }
41
41
  //
42
42
  /**
43
- * For generic actions where you want to specify the return type
44
- * Just a type helper, does nothing at runtime
43
+ * For generic actions - preserves the generic parameter
45
44
  */
46
45
  export function genericAction(fn) {
47
- return () => fn;
46
+ // Return a function that takes a type parameter and returns the typed function
47
+ return () => {
48
+ return fn;
49
+ };
48
50
  }
49
51
  /**
50
- * For fixed actions - just returns the function
51
- * The type parameter T is for convenience when you want to override the return type
52
+ * For fixed actions
52
53
  */
53
54
  export function fixedAction(fn) {
54
- return () => fn;
55
+ return () => {
56
+ return fn;
57
+ };
55
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pogodisco/zephyr",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },