Skip to content

Commit

Permalink
refactor options hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshidwivedi committed Jun 22, 2024
1 parent 9c34c00 commit d5dc0e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common/recoil/options/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { optionsAtom } from "./options.atoms"
import { useOptions } from "./options.hooks"
import { useOptions, useOptionsValue, useSetOptions } from "./options.hooks"

export default optionsAtom;
export {useOptions};
export {useOptionsValue, useSetOptions, useOptions};
10 changes: 8 additions & 2 deletions common/recoil/options/options.hooks.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import {useRecoilValue, useSetRecoilState} from "recoil";
import {optionsAtom} from "./options.atoms";

export const useOptions = () => {
export const useOptionsValue = () => {
const options= useRecoilValue(optionsAtom);
return options;
};

export const useOptions = () => {
const options = useRecoilValue(optionsAtom);
return options;

};

export const useSetOptions = () => {
const setOptions = useSetRecoilState(optionsAtom);
return setOptions;
}
};

0 comments on commit d5dc0e2

Please sign in to comment.