react-auth-verification-context
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,8 +0,8 @@ | ||
import { FC, ReactNode } from "react"; | ||
import { TAuth } from "../reducers/auth.reducer"; | ||
interface iAuthProviderProps { | ||
import { FC, ReactNode } from 'react'; | ||
import { TAuth } from '../reducers/auth.reducer'; | ||
interface IAuthProviderProps { | ||
children: ReactNode; | ||
} | ||
declare const AuthProvider: FC<iAuthProviderProps>; | ||
declare const AuthProvider: FC<IAuthProviderProps>; | ||
declare function useAuth(): TAuth; | ||
export { AuthProvider, useAuth }; |
@@ -10,5 +10,12 @@ "use strict"; | ||
attributes: null, | ||
login: () => { }, | ||
logout: () => { }, | ||
restoreToken: () => { }, | ||
isAuthenticated: false, | ||
login: () => { | ||
return null; | ||
}, | ||
logout: () => { | ||
return null; | ||
}, | ||
restoreToken: () => { | ||
return null; | ||
}, | ||
}); | ||
@@ -36,3 +43,3 @@ const AuthProvider = (0, react_1.memo)(({ children }) => { | ||
if (context === undefined) { | ||
throw new Error("useAuthState must be used within a AuthProvider"); | ||
throw new Error('useAuthState must be used within a AuthProvider'); | ||
} | ||
@@ -39,0 +46,0 @@ return context; |
@@ -1,2 +0,2 @@ | ||
export { AuthProvider, useAuth } from "./context/auth.context"; | ||
export { AuthActions } from "./reducers/auth.reducer"; | ||
export { AuthProvider, useAuth } from './context/auth.context'; | ||
export { AuthActions } from './reducers/auth.reducer'; |
@@ -10,3 +10,3 @@ export declare enum AuthActions { | ||
attributes: any; | ||
isAuthenticated?: boolean; | ||
isAuthenticated: boolean; | ||
login: (a: any) => void; | ||
@@ -18,5 +18,5 @@ logout: () => void; | ||
export interface IAuthReducer { | ||
type: AuthActions | ""; | ||
type: AuthActions | ''; | ||
payload: any; | ||
} | ||
export declare const authReducer: (state: TAuth, action: IAuthReducer) => TAuth; |
{ | ||
"name": "react-auth-verification-context", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "react-auth-verification-context is a library that provides a way to manage authentication state in a React application. It is implemented using the React context API, which allows you to pass data through the component tree without having to pass props down manually at every level.", | ||
@@ -22,18 +22,34 @@ "keywords": [ | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "tsc" | ||
"test": "jest --config jestconfig.json", | ||
"build": "tsc", | ||
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"lint": "tslint -p tsconfig.json", | ||
"prepare": "npm run build", | ||
"prepublishOnly": "npm test && npm run lint", | ||
"preversion": "npm run lint", | ||
"version": "npm run format && git add -A src", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/abgaryanharutyun/react-auth-context.git" | ||
"url": "git+https://github.com/abgaryanharutyun/react-auth-verification-context.git" | ||
}, | ||
"author": "", | ||
"author": "Harutyun Abgaryan <harutyunabgaryan@gmail.com>", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/abgaryanharutyun/react-auth-context/issues" | ||
"url": "https://github.com/abgaryanharutyun/react-auth-verification-context/issues" | ||
}, | ||
"homepage": "https://github.com/abgaryanharutyun/react-auth-context#readme", | ||
"homepage": "https://github.com/abgaryanharutyun/react-auth-verification-context#readme", | ||
"devDependencies": { | ||
"@testing-library/react": "^13.4.0", | ||
"@types/jest": "^29.2.4", | ||
"@types/react": "^18.0.26", | ||
"jest": "^29.3.1", | ||
"jest-environment-jsdom": "^29.3.1", | ||
"prettier": "^2.8.1", | ||
"ts-jest": "^29.0.3", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^4.9.4" | ||
@@ -43,3 +59,6 @@ }, | ||
"react": "^18.2.0" | ||
} | ||
}, | ||
"files": [ | ||
"lib/**/*" | ||
] | ||
} |
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
0
1
11202
10
10
180