🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-fast-hoc

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fast-hoc - npm Package Compare versions

Comparing version

to
0.3.2

7

CHANGELOG.md
# 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 @@

2

lib/index.d.ts

@@ -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
![Version](https://badgen.net/npm/v/react-fast-hoc) ![Ts support](https://badgen.net/npm/types/react-fast-hoc) ![Size](https://badgen.net/bundlephobia/min/react-fast-hoc) ![Size gzip](https://badgen.net/bundlephobia/minzip/react-fast-hoc) ![Tree shaking](https://badgen.net/bundlephobia/tree-shaking/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.
[![Version](https://img.shields.io/npm/v/react-fast-hoc)](https://www.npmjs.com/package/react-fast-hoc)
[![Size](https://img.shields.io/bundlephobia/minzip/react-fast-hoc)](https://bundlephobia.com/package/react-fast-hoc)
[![Downloads](https://img.shields.io/npm/dt/react-fast-hoc.svg)](https://www.npmjs.com/package/react-fast-hoc)
<!-- [![Tree shaking](https://img.shields.io/bundlephobia/tree-shaking/react-fast-hoc)](https://bundlephobia.com/package/react-fast-hoc) -->
![Demonstration](./code.png)

@@ -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