Skip to content

Commit

Permalink
refactor: bump jotai to 2.0.3 + wrap debugPrivate with env check
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunvegda committed Mar 3, 2023
1 parent 8b891aa commit 3064f6c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"html-webpack-plugin": "^5.5.0",
"jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.1",
"jotai": "https://pkg.csb.dev/pmndrs/jotai/commit/5e0c7f9e/jotai/_pkg.tgz",
"jotai": "^2.0.3",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.3",
Expand Down
31 changes: 14 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/atomWithLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ export function atomWithLocation<T>(options?: Options<T>) {
const sub = options?.subscribe || subscribe;
const baseAtom = atom(options?.preloaded ?? getL());

// FIXME Wrap this with a dev only check, may require changes to our bundle tooling
baseAtom.debugPrivate = true;
if (process.env.NODE_ENV !== 'production') {
baseAtom.debugPrivate = true;
}

baseAtom.onMount = (set) => {
const callback = () => set(getL());
Expand Down

0 comments on commit 3064f6c

Please sign in to comment.