jotai-optics
Advanced tools
Comparing version 0.3.0 to 0.3.1
import type { SetStateAction, WritableAtom } from 'jotai/vanilla'; | ||
import * as O from 'optics-ts'; | ||
type NonFunction<T> = [T] extends [(...args: any[]) => any] ? never : T; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, callback: (optic: O.OpticFor<S>) => O.Prism<S, any, A>): WritableAtom<Promise<A | undefined>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, callback: (optic: O.OpticFor<S>) => O.Traversal<S, any, A>): WritableAtom<Promise<A[]>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, callback: (optic: O.OpticFor<S>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<Promise<A>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, callback: (optic: O.OpticFor<S | undefined>) => O.Prism<S, any, A>): WritableAtom<Promise<A | undefined>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, callback: (optic: O.OpticFor<S | undefined>) => O.Traversal<S, any, A>): WritableAtom<Promise<A[]>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, callback: (optic: O.OpticFor<S | undefined>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<Promise<A>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S, [NonFunction<S>], R>, callback: (optic: O.OpticFor<S>) => O.Prism<S, any, A>): WritableAtom<A | undefined, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S, [NonFunction<S>], R>, callback: (optic: O.OpticFor<S>) => O.Traversal<S, any, A>): WritableAtom<A[], [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S, [NonFunction<S>], R>, callback: (optic: O.OpticFor<S>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<A, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, callback: (optic: O.OpticFor<S | undefined>) => O.Prism<S, any, A>): WritableAtom<A | undefined, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, callback: (optic: O.OpticFor<S | undefined>) => O.Traversal<S, any, A>): WritableAtom<A[], [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, callback: (optic: O.OpticFor<S | undefined>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<A, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, callback: (optic: O.OpticFor_<S>) => O.Prism<S, any, A>): WritableAtom<Promise<A | undefined>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, callback: (optic: O.OpticFor_<S>) => O.Traversal<S, any, A>): WritableAtom<Promise<A[]>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, callback: (optic: O.OpticFor_<S>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<Promise<A>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, callback: (optic: O.OpticFor_<S | undefined>) => O.Prism<S, any, A>): WritableAtom<Promise<A | undefined>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, callback: (optic: O.OpticFor_<S | undefined>) => O.Traversal<S, any, A>): WritableAtom<Promise<A[]>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, callback: (optic: O.OpticFor_<S | undefined>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<Promise<A>, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S, [NonFunction<S>], R>, callback: (optic: O.OpticFor_<S>) => O.Prism<S, any, A>): WritableAtom<A | undefined, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S, [NonFunction<S>], R>, callback: (optic: O.OpticFor_<S>) => O.Traversal<S, any, A>): WritableAtom<A[], [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S, [NonFunction<S>], R>, callback: (optic: O.OpticFor_<S>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<A, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, callback: (optic: O.OpticFor_<S | undefined>) => O.Prism<S, any, A>): WritableAtom<A | undefined, [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, callback: (optic: O.OpticFor_<S | undefined>) => O.Traversal<S, any, A>): WritableAtom<A[], [SetStateAction<A>], R>; | ||
export declare function focusAtom<S, A, R>(baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, callback: (optic: O.OpticFor_<S | undefined>) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A>): WritableAtom<A, [SetStateAction<A>], R>; | ||
export {}; |
export { focusAtom } from './focusAtom'; |
{ | ||
"name": "jotai-optics", | ||
"description": "👻💎", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"author": "merisbahti", | ||
@@ -33,3 +33,3 @@ "contributors": [ | ||
"scripts": { | ||
"compile": "microbundle build -f modern,umd --globals react=React", | ||
"compile": "microbundle build -f modern,umd --globals react=React && pnpm run postcompile", | ||
"postcompile": "cp dist/index.modern.mjs dist/index.modern.js && cp dist/index.modern.mjs.map dist/index.modern.js.map", | ||
@@ -53,36 +53,35 @@ "test": "run-s eslint tsc-test jest", | ||
"license": "MIT", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@testing-library/react": "^13.4.0", | ||
"@types/jest": "^29.4.0", | ||
"@types/react": "^18.0.27", | ||
"@types/react-dom": "^18.0.10", | ||
"@typescript-eslint/eslint-plugin": "^5.50.0", | ||
"@typescript-eslint/parser": "^5.50.0", | ||
"eslint": "^8.33.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"@testing-library/react": "^14.0.0", | ||
"@types/jest": "^29.5.3", | ||
"@types/react": "^18.2.18", | ||
"@types/react-dom": "^18.2.7", | ||
"@typescript-eslint/eslint-plugin": "^5.62.0", | ||
"@typescript-eslint/parser": "^5.62.0", | ||
"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-jest": "^27.2.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-import": "^2.28.0", | ||
"eslint-plugin-jest": "^27.2.3", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"eslint-plugin-react": "^7.33.1", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"expect-type": "^0.15.0", | ||
"html-webpack-plugin": "^5.5.0", | ||
"jest": "^29.4.1", | ||
"jest-environment-jsdom": "^29.4.1", | ||
"jotai": "^2.0.0", | ||
"expect-type": "^0.16.0", | ||
"html-webpack-plugin": "^5.5.3", | ||
"jest": "^29.6.2", | ||
"jest-environment-jsdom": "^29.6.2", | ||
"jotai": "^2.2.3", | ||
"microbundle": "^0.15.1", | ||
"npm-run-all": "^4.1.5", | ||
"optics-ts": "^2.4.0", | ||
"prettier": "^2.8.3", | ||
"optics-ts": "^2.4.1", | ||
"prettier": "^3.0.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-error-boundary": "^3.1.4", | ||
"ts-jest": "^29.0.5", | ||
"ts-loader": "^9.4.2", | ||
"typescript": "^4.9.5", | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^5.0.1", | ||
"webpack-dev-server": "^4.11.1" | ||
"react-error-boundary": "^4.0.10", | ||
"ts-jest": "^29.1.1", | ||
"ts-loader": "^9.4.4", | ||
"typescript": "^5.1.6", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "^4.15.1" | ||
}, | ||
@@ -89,0 +88,0 @@ "peerDependencies": { |
@@ -22,3 +22,3 @@ import { atom } from 'jotai/vanilla' | ||
baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, | ||
callback: (optic: O.OpticFor<S>) => O.Prism<S, any, A> | ||
callback: (optic: O.OpticFor_<S>) => O.Prism<S, any, A> | ||
): WritableAtom<Promise<A | undefined>, [SetStateAction<A>], R> | ||
@@ -28,3 +28,3 @@ | ||
baseAtom: WritableAtom<Promise<S>, [Promise<S>], R>, | ||
callback: (optic: O.OpticFor<S>) => O.Traversal<S, any, A> | ||
callback: (optic: O.OpticFor_<S>) => O.Traversal<S, any, A> | ||
): WritableAtom<Promise<A[]>, [SetStateAction<A>], R> | ||
@@ -35,3 +35,3 @@ | ||
callback: ( | ||
optic: O.OpticFor<S> | ||
optic: O.OpticFor_<S> | ||
) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A> | ||
@@ -44,3 +44,3 @@ ): WritableAtom<Promise<A>, [SetStateAction<A>], R> | ||
baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, | ||
callback: (optic: O.OpticFor<S | undefined>) => O.Prism<S, any, A> | ||
callback: (optic: O.OpticFor_<S | undefined>) => O.Prism<S, any, A> | ||
): WritableAtom<Promise<A | undefined>, [SetStateAction<A>], R> | ||
@@ -50,3 +50,3 @@ | ||
baseAtom: WritableAtom<Promise<S | undefined>, [Promise<S>], R>, | ||
callback: (optic: O.OpticFor<S | undefined>) => O.Traversal<S, any, A> | ||
callback: (optic: O.OpticFor_<S | undefined>) => O.Traversal<S, any, A> | ||
): WritableAtom<Promise<A[]>, [SetStateAction<A>], R> | ||
@@ -57,3 +57,3 @@ | ||
callback: ( | ||
optic: O.OpticFor<S | undefined> | ||
optic: O.OpticFor_<S | undefined> | ||
) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A> | ||
@@ -66,3 +66,3 @@ ): WritableAtom<Promise<A>, [SetStateAction<A>], R> | ||
baseAtom: WritableAtom<S, [NonFunction<S>], R>, | ||
callback: (optic: O.OpticFor<S>) => O.Prism<S, any, A> | ||
callback: (optic: O.OpticFor_<S>) => O.Prism<S, any, A> | ||
): WritableAtom<A | undefined, [SetStateAction<A>], R> | ||
@@ -72,3 +72,3 @@ | ||
baseAtom: WritableAtom<S, [NonFunction<S>], R>, | ||
callback: (optic: O.OpticFor<S>) => O.Traversal<S, any, A> | ||
callback: (optic: O.OpticFor_<S>) => O.Traversal<S, any, A> | ||
): WritableAtom<A[], [SetStateAction<A>], R> | ||
@@ -79,3 +79,3 @@ | ||
callback: ( | ||
optic: O.OpticFor<S> | ||
optic: O.OpticFor_<S> | ||
) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A> | ||
@@ -88,3 +88,3 @@ ): WritableAtom<A, [SetStateAction<A>], R> | ||
baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, | ||
callback: (optic: O.OpticFor<S | undefined>) => O.Prism<S, any, A> | ||
callback: (optic: O.OpticFor_<S | undefined>) => O.Prism<S, any, A> | ||
): WritableAtom<A | undefined, [SetStateAction<A>], R> | ||
@@ -94,3 +94,3 @@ | ||
baseAtom: WritableAtom<S | undefined, [NonFunction<S>], R>, | ||
callback: (optic: O.OpticFor<S | undefined>) => O.Traversal<S, any, A> | ||
callback: (optic: O.OpticFor_<S | undefined>) => O.Traversal<S, any, A> | ||
): WritableAtom<A[], [SetStateAction<A>], R> | ||
@@ -101,3 +101,3 @@ | ||
callback: ( | ||
optic: O.OpticFor<S | undefined> | ||
optic: O.OpticFor_<S | undefined> | ||
) => O.Lens<S, any, A> | O.Equivalence<S, any, A> | O.Iso<S, any, A> | ||
@@ -111,3 +111,3 @@ ): WritableAtom<A, [SetStateAction<A>], R> | ||
callback: ( | ||
optic: O.OpticFor<S> | ||
optic: O.OpticFor_<S> | ||
) => | ||
@@ -114,0 +114,0 @@ | O.Lens<S, any, A> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33634
13