├── example ├── .env ├── public │ ├── favicon.ico │ ├── manifest.json │ └── index.html ├── README.md ├── src │ ├── Counter.js │ └── index.js ├── .gitignore └── package.json ├── .gitignore ├── .prettierrc ├── .editorconfig ├── CHANGELOG.md ├── src ├── index.ts ├── context.ts ├── useState.ts ├── StateInspector.tsx └── useReducer.ts ├── tests ├── test.setup.js ├── tsconfig.json └── index.test.tsx ├── .eslintrc.js ├── tsconfig.json ├── LICENSE ├── package.json └── README.md /example/.env: -------------------------------------------------------------------------------- 1 | SKIP_PREFLIGHT_CHECK=true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /node_modules 3 | .vscode 4 | *.log 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "semi": false 4 | } 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | trim_trailing_whitespace = true 3 | insert_final_newline = true -------------------------------------------------------------------------------- /example/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/troch/reinspect/HEAD/example/public/favicon.ico -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # v1.1.0 2 | 3 | Maintenance release: 4 | 5 | - Update dependencies 6 | - Move to tsdx 7 | - TypeScript strict mode 8 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Reinspect example 2 | 3 | To run: 4 | 5 | - install dependencies with yarn (`yarn`) 6 | - run the example with `yarn start` 7 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export { StateInspector } from "./StateInspector" 2 | export { useReducer } from "./useReducer" 3 | export { useState } from "./useState" 4 | -------------------------------------------------------------------------------- /tests/test.setup.js: -------------------------------------------------------------------------------- 1 | const Enzyme = require("enzyme") 2 | const Adapter = require("enzyme-adapter-react-16") 3 | 4 | Enzyme.configure({ adapter: new Adapter() }) 5 | -------------------------------------------------------------------------------- /tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | // "strict": true, 6 | }, 7 | "files": ["./index.test.tsx"] 8 | } 9 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | "react-app", 4 | "prettier/@typescript-eslint", 5 | "plugin:prettier/recommended" 6 | ], 7 | settings: { 8 | react: { 9 | version: "detect" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /example/src/Counter.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { useState } from "reinspect" 3 | 4 | export function Counter({ id }) { 5 | const [count, setCount] = useState(0, id) 6 | 7 | return ( 8 |
Open redux devtools to see it in action!
21 | ) : ( 22 |23 | You need Redux dev tools:{" "} 24 | 25 | https://github.com/zalmoxisus/redux-devtools-extension 26 | 27 |
28 | )} 29 |30 | 31 | 32 | 35 |
36 | 37 | {Array.from({ length: count }).map((_, index) => ( 38 |Hello
153 |