tanbal-hooks 1.0.1 → 1.0.3

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.
@@ -12,7 +12,7 @@ const useDataManager = (url) => {
12
12
  ) => {
13
13
  try {
14
14
  setStatus('loading');
15
- const result = await Fetch(url);
15
+ const result = await request(url);
16
16
  setData(result.data);
17
17
  setStatus('loaded');
18
18
  successCallback(result.data);
@@ -34,7 +34,7 @@ const useDataManager = (url) => {
34
34
  finallyCallback = () => {},
35
35
  ) => {
36
36
  try {
37
- const result = await Fetch(url, {
37
+ const result = await request(url, {
38
38
  method: 'POST',
39
39
  headers: {
40
40
  'Content-Type': 'application/json',
@@ -63,7 +63,7 @@ const useDataManager = (url) => {
63
63
  ) => {
64
64
 
65
65
  try {
66
- const result = await Fetch(`${url}/${id}`, {
66
+ const result = await request(`${url}/${id}`, {
67
67
  method: 'PATCH',
68
68
  headers: {
69
69
  'Content-Type': 'application/json',
@@ -90,7 +90,7 @@ const useDataManager = (url) => {
90
90
  finallyCallback = () => {},
91
91
  ) => {
92
92
  try {
93
- const result = await Fetch(url, {
93
+ const result = await request(url, {
94
94
  method: 'PATCH',
95
95
  headers: {
96
96
  'Content-Type': 'application/json',
@@ -117,7 +117,7 @@ const useDataManager = (url) => {
117
117
  finallyCallback = () => {},
118
118
  ) => {
119
119
  try {
120
- const result = await Fetch(`${url}/${id}`, {
120
+ const result = await request(`${url}/${id}`, {
121
121
  method: 'DELETE',
122
122
  headers: {
123
123
  'Content-Type': 'application/json',
@@ -1,4 +1,4 @@
1
- import { useRef } from "react";
1
+ import { useEffect, useRef } from "react";
2
2
 
3
3
  const useInputBlur = (
4
4
  time,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tanbal-hooks",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A collection of custom React and Next.js hooks.",
5
5
  "keywords": [
6
6
  "react",