Skip to content

Commit

Permalink
build(config): fix config issue
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Mar 21, 2024
1 parent 2e3fc00 commit 99edd44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-travel",
"version": "0.1.2",
"version": "0.1.3",
"description": "A React hook for state time travel with undo, redo, and reset functionalities.",
"main": "dist/index.cjs.js",
"unpkg": "dist/index.umd.js",
Expand Down
3 changes: 2 additions & 1 deletion rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
sourcemap: true,
globals: {
mutative: 'Mutative',
react: 'React',
},
exports: 'named',
},
Expand All @@ -43,5 +44,5 @@ export default {
}),
terser(),
],
external: ['mutative'],
external: ['mutative', 'react'],
};
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type TravelPatches = {
inversePatches: Patches[];
};

type Options<A extends boolean, F extends boolean> = {
type Options<F extends boolean> = {
maxHistory?: number;
initialPatches?: TravelPatches;
} & MutativeOptions<true, F>;
Expand Down Expand Up @@ -76,9 +76,9 @@ type Result<S, F extends boolean> = [
/**
* A hook to travel in the history of a state
*/
export const useTravel = <S, A extends boolean, F extends boolean>(
export const useTravel = <S, F extends boolean>(
initialState: S,
{ maxHistory = 10, initialPatches, ...options }: Options<A, F> = {}
{ maxHistory = 10, initialPatches, ...options }: Options<F> = {}
) => {
const resetRef = useRef(false);
const [position, setPosition] = useMutative(-1);
Expand Down

0 comments on commit 99edd44

Please sign in to comment.