Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dev dependencies #2051

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"import/extensions": ["error", "always"],
"import/no-unresolved": ["error", { "commonjs": true, "amd": true }],
"import/export": "error",
"@typescript-eslint/no-duplicate-imports": ["error"],
"import/no-duplicates": ["error"],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-multiple-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- 18.0.0
- 18.1.0
- 18.2.0
- 18.3.0-canary-035a41c4e-20230704
- 0.0.0-experimental-035a41c4e-20230704
- 18.3.0-canary-493f72b0a-20230727
- 0.0.0-experimental-493f72b0a-20230727
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down
8 changes: 4 additions & 4 deletions docs/integrations/urql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const Counter = () => {
```tsx
type AtomWithQueryOptions<
Data = unknown,
Variables extends AnyVariables = AnyVariables
Variables extends AnyVariables = AnyVariables,
> = {
// Supports string query, typed-document-node, document node etc.
query: DocumentInput<Data, Variables>
Expand All @@ -88,7 +88,7 @@ type AtomWithQueryOptions<

type AtomWithMutationOptions<
Data = unknown,
Variables extends AnyVariables = AnyVariables
Variables extends AnyVariables = AnyVariables,
> = {
query: DocumentInput<Data, Variables>
getClient?: (get: Getter) => Client
Expand Down Expand Up @@ -130,7 +130,7 @@ import type { AtomWithQuery } from 'jotai-urql'

export const useQueryAtomData = <
Data = unknown,
Variables extends AnyVariables = AnyVariables
Variables extends AnyVariables = AnyVariables,
>(
queryAtom: AtomWithQuery<Data, Variables>
) => {
Expand Down Expand Up @@ -163,7 +163,7 @@ export const useQueryAtomData = <
return [opResult.data, dispatch, opResult] as [
Exclude<typeof opResult.data, undefined>,
typeof dispatch,
typeof opResult
typeof opResult,
]
}

Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@
},
"homepage": "https://github.com/pmndrs/jotai",
"devDependencies": {
"@babel/core": "^7.22.6",
"@babel/core": "^7.22.9",
"@babel/plugin-transform-react-jsx": "^7.22.5",
"@babel/plugin-transform-typescript": "^7.22.5",
"@babel/preset-env": "^7.22.6",
"@babel/plugin-transform-typescript": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/template": "^7.22.5",
"@babel/types": "^7.22.5",
"@redux-devtools/extension": "^3.2.5",
Expand All @@ -130,40 +130,40 @@
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/babel__core": "^7.20.1",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@vitest/coverage-c8": "^0.32.4",
"@vitest/ui": "^0.32.4",
"@types/react": "^18.2.17",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@vitest/coverage-c8": "^0.33.0",
"@vitest/ui": "^0.33.0",
"benny": "^3.7.1",
"concurrently": "^8.2.0",
"downlevel-dts": "^0.11.0",
"esbuild": "^0.18.11",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"esbuild": "^0.18.17",
"eslint": "^8.46.0",
"eslint-config-prettier": "^8.9.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-vitest": "^0.2.6",
"eslint-plugin-vitest": "^0.2.8",
"jsdom": "^22.1.0",
"json": "^11.0.0",
"prettier": "^2.8.8",
"prettier": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux": "^4.2.1",
"rollup": "^3.26.1",
"rollup": "^3.27.0",
"rollup-plugin-esbuild": "^5.0.0",
"rxjs": "^7.8.1",
"shx": "^0.3.4",
"ts-expect": "^1.3.0",
"ts-node": "^10.9.1",
"tslib": "^2.6.0",
"tslib": "^2.6.1",
"typescript": "^5.1.6",
"vitest": "^0.32.4",
"wonka": "^6.3.2"
"vitest": "^0.33.0",
"wonka": "^6.3.3"
},
"peerDependencies": {
"react": ">=17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/react/useAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function useAtom<AtomType extends WritableAtom<any, any[], any>>(
options?: Options
): [
Awaited<ExtractAtomValue<AtomType>>,
SetAtom<ExtractAtomArgs<AtomType>, ExtractAtomResult<AtomType>>
SetAtom<ExtractAtomArgs<AtomType>, ExtractAtomResult<AtomType>>,
]

export function useAtom<AtomType extends Atom<any>>(
Expand Down
2 changes: 1 addition & 1 deletion src/vanilla/atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type WithInitialValue<Value> = {
type OnUnmount = () => void

type OnMount<Args extends unknown[], Result> = <
S extends SetAtom<Args, Result>
S extends SetAtom<Args, Result>,
>(
setAtom: S
) => OnUnmount | void
Expand Down
7 changes: 5 additions & 2 deletions src/vanilla/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,11 @@ export const createStore = () => {
}
try {
const valueOrPromise = atom.read(getter, options as any)
return setAtomValueOrPromise(atom, valueOrPromise, nextDependencies, () =>
controller?.abort()
return setAtomValueOrPromise(
atom,
valueOrPromise,
nextDependencies,
() => controller?.abort()
)
} catch (error) {
return setAtomError(atom, error, nextDependencies)
Expand Down
2 changes: 1 addition & 1 deletion src/vanilla/utils/freezeAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function freezeAtom<AtomType extends Atom<any>>(
}

export function freezeAtomCreator<
CreateAtom extends (...params: any[]) => Atom<any>
CreateAtom extends (...params: any[]) => Atom<any>,
>(createAtom: CreateAtom) {
return ((...params: any[]) => {
const anAtom = createAtom(...params)
Expand Down
2 changes: 1 addition & 1 deletion src/vanilla/utils/selectAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function selectAtom<Value, Slice>(
const EMPTY = Symbol()
const selectValue = ([value, prevSlice]: readonly [
Awaited<Value>,
Slice | typeof EMPTY
Slice | typeof EMPTY,
]) => {
if (prevSlice === EMPTY) {
return selector(value)
Expand Down
17 changes: 10 additions & 7 deletions src/vanilla/utils/unwrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ export function unwrap<Value, Args extends unknown[], Result, PendingValue>(
promiseAndValueAtom.debugPrivate = true
}

return atom((get) => {
const state = get(promiseAndValueAtom)
if ('v' in state) {
return state.v
}
return state.f
}, (anAtom as WritableAtom<Value, unknown[], unknown>).write)
return atom(
(get) => {
const state = get(promiseAndValueAtom)
if ('v' in state) {
return state.v
}
return state.f
},
(anAtom as WritableAtom<Value, unknown[], unknown>).write
)
},
anAtom,
fallback
Expand Down
Loading
Loading