react-fast-hoc
Advanced tools
Comparing version
# react-fast-hoc | ||
## 0.3.2 | ||
### Patch Changes | ||
- 0920933: Removed deprecated api examples from README | ||
Fixes: [#20](https://github.com/XantreGodlike/react-fast-hoc/issues/20) | ||
## 0.3.1 | ||
@@ -4,0 +11,0 @@ |
@@ -84,3 +84,3 @@ import { ComposeLeft, Objects, Booleans, Fn, Call, Identity } from 'hotscript'; | ||
*/ | ||
declare const createHoc: <TPipeTransform extends Fn[] | HocTypeTransform<any, any>, ComponentPropsExtends extends PropsBase = PropsBase, TActualTransform extends HocTypeTransform<any, any> = TPipeTransform extends Fn[] ? HocTypeTransform<"props", ComposeLeft<TPipeTransform>> : TPipeTransform>(params: CreateHocOptions) => CreateHocReturn<TActualTransform, ComponentPropsExtends>; | ||
declare const createHoc: <TPipeTransform extends Fn[] | HocTypeTransform<any, any>, TComponentPropsExtends extends PropsBase = PropsBase, TActualTransform extends HocTypeTransform<any, any> = TPipeTransform extends Fn[] ? HocTypeTransform<"props", ComposeLeft<TPipeTransform>> : TPipeTransform>(params: CreateHocOptions) => CreateHocReturn<TActualTransform, TComponentPropsExtends>; | ||
@@ -87,0 +87,0 @@ /** |
{ | ||
"name": "react-fast-hoc", | ||
"license": "MIT", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"sideEffects": false, | ||
@@ -6,0 +6,0 @@ "type": "module", |
# React Fast HOC | ||
     | ||
Lightweight and type-safe High-Order Components (HOCs) library for React, leveraging high-order types from [`hotscript`](https://github.com/gvergnaud/hotscript) and JavaScript Proxies for zero VDOM overhead. | ||
Lightweight and type-safe High-Order Components (HOCs) library for React, leveraging high-order types from "hotscript" and JavaScript Proxies for zero VDOM overhead and blazing-fast performance. | ||
[](https://www.npmjs.com/package/react-fast-hoc) | ||
[](https://bundlephobia.com/package/react-fast-hoc) | ||
[](https://www.npmjs.com/package/react-fast-hoc) | ||
<!-- [](https://bundlephobia.com/package/react-fast-hoc) --> | ||
 | ||
@@ -48,3 +52,3 @@ | ||
Install the `hotscript` for advanced usage: | ||
Install the `hotscript` for creating complex props transformations: | ||
@@ -89,3 +93,3 @@ ```sh | ||
}), | ||
{ nameRewrite: "BirthdayInput" } | ||
{ displayNameTransform: { type: "rewrite", value: "BirthdayInput" } } | ||
); | ||
@@ -100,3 +104,3 @@ ``` | ||
```typescript | ||
```ts | ||
import { transformProps } from "react-fast-hoc"; | ||
@@ -110,3 +114,3 @@ | ||
}, | ||
{ namePrefix: "WithTransformedProps." } | ||
{ displayNameTransform: { type: "rewrite", value: "WithTransformedProps." } } | ||
); | ||
@@ -119,7 +123,6 @@ ``` | ||
```typescript | ||
```ts | ||
import { createHoc } from "react-fast-hoc"; | ||
const withCustomLogic = createHoc({ | ||
namePrefix: "WithCustomLogic", | ||
propsTransformer: (props) => { | ||
@@ -130,3 +133,6 @@ // Apply custom logic here | ||
resultTransformer: null, | ||
nameRewrite: null, | ||
displayNameTransform: { | ||
type: "prefix", | ||
value: "WithCustomLogic.", | ||
}, | ||
}); | ||
@@ -149,3 +155,8 @@ | ||
}, | ||
{ namePrefix: "WithTransformedProps." } | ||
{ | ||
displayNameTransform: { | ||
type: "prefix", | ||
value: "WithTransformedProps.", | ||
}, | ||
} | ||
); | ||
@@ -152,0 +163,0 @@ |
@@ -43,3 +43,3 @@ import type { ComposeLeft, Fn } from "hotscript"; | ||
TPipeTransform extends Fn[] | HocTypeTransform<any, any>, | ||
ComponentPropsExtends extends PropsBase = PropsBase, | ||
TComponentPropsExtends extends PropsBase = PropsBase, | ||
TActualTransform extends HocTypeTransform< | ||
@@ -71,3 +71,3 @@ any, | ||
mimicToHandler | ||
)) as CreateHocReturn<TActualTransform, ComponentPropsExtends>; | ||
)) as CreateHocReturn<TActualTransform, TComponentPropsExtends>; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
140185
0.37%173
6.79%1
Infinity%