fenextjs-hook
Advanced tools
Comparing version 1.0.18 to 1.2.0
export * from "./useData"; | ||
export * from "./useModal"; | ||
export * from "./useRequest"; | ||
export * from "./useNotification"; |
@@ -7,2 +7,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./useRequest"), exports); | ||
tslib_1.__exportStar(require("./useNotification"), exports); | ||
//# sourceMappingURL=index.js.map |
export * from "./useData"; | ||
export * from "./useModal"; | ||
export * from "./useRequest"; | ||
export * from "./useNotification"; |
export * from "./useData"; | ||
export * from "./useModal"; | ||
export * from "./useRequest"; | ||
export * from "./useNotification"; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "fenextjs-hook", | ||
"version": "1.0.18", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cjs/index.js", |
@@ -74,15 +74,14 @@ # fenextjs-hook | ||
const { | ||
result // result of request, | ||
loader // boolean of loader, | ||
error // error failing the request | ||
onRequest // function request, | ||
} = useRequest< | ||
QueryProps, // intefate of query | ||
ResultProps //interface of result | ||
ErrorProps //interface of error Memo(optional) | ||
>({ | ||
query, // query by use in request | ||
request, // function request | ||
autoRequest, // boolean if auto execute request is change query (optional)(default = false) | ||
}); | ||
result, // result of request, | ||
loader, // boolean of loader, | ||
error, // error failing the request | ||
onRequest, // function request, | ||
} = useRequest < QueryProps, // intefate of query | ||
ResultProps; //interface of result | ||
ErrorProps > //interface of error Memo(optional) | ||
{ | ||
query, // query by use in request | ||
request, // function request | ||
autoRequest, // boolean if auto execute request is change query (optional)(default = false) | ||
}; | ||
``` | ||
@@ -121,3 +120,30 @@ | ||
## useNotification | ||
Hook to show or remove notifications | ||
```ts | ||
//for CJS | ||
import { useNotification } from "fenextjs-hook/cjs/useNotification"; | ||
//for ESM | ||
import { useNotification } from "fenextjs-hook/esm/useNotification"; | ||
//type of notification | ||
type NotificationType = "none" | "normal" | "ok" | "error" | "warning"; | ||
//iterfate of notification | ||
interface NotificationProps { | ||
type?: NotificationType; | ||
message: string; | ||
} | ||
const { | ||
loadNotification, // boolean if load notification, | ||
notification, // value of notification, interface NotificationProps | ||
pop, // function of add notification by time | ||
reset, // reset notification (remove) | ||
} = useNotification({ | ||
time: 2000, // time of show notification (optional)(default = 2000) | ||
}); | ||
``` | ||
## Developer | ||
@@ -133,2 +159,2 @@ | ||
- [Gitlab](https://gitlab.com/franciscoblancojn/fenextjs-hook) | ||
- [Gitlab](https://gitlab.com/franciscoblancojn/fenextjs-hook) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25357
32
380
158
0