This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { atom, reatomAsync, withStatusesAtom } from '@reatom/framework'; | |
import { | |
FunnelMinorFileType, | |
FileType, | |
type FunnelMinorFile as AssetFile, | |
type UpdateFunnelDataInput, | |
} from 'src/__generated__/graphql'; | |
import { t } from 'src/admin/i18n'; | |
import { type FormFieldOptions, reatomForm } from 'src/reatom-form'; | |
import { reatomObjectUrl } from 'src/shared/reatomObjectUrl'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const listResource = reatomResource( | |
(ctx) => request("api/list", ctx.controller), | |
"listResource" | |
).pipe(withCache(), withDataAtom([])); | |
export const updateList = reatomAction(async () => { | |
/* */ | |
}, "updateList").pipe(withVariables()); | |
export const List = reatomComponent(({ ctx }) => ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx cloc compiler | |
3668 text files. | |
2905 unique files. | |
767 files ignored. | |
github.com/AlDanial/cloc v 2.00 T=1.10 s (2642.9 files/s, 139378.2 lines/s) | |
------------------------------------------------------------------------------- | |
Language files blank comment code | |
------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable */ | |
// https://github.com/Chronstruct/display-primitives/issues/1#issuecomment-1518496207 | |
// declare global { | |
// namespace JSX { | |
// interface IntrinsicElements<T extends string> { | |
// input: React.DetailedHTMLProps< | |
// React.InputHTMLAttributes<HTMLInputElement>, | |
// HTMLInputElement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
type AsyncAction, | |
action, | |
atom, | |
spawn, | |
take, | |
toAbortError, | |
isCausedBy, | |
} from '@reatom/framework'; | |
import { reatomComponent } from '@reatom/npm-react'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in the app root | |
export const ROUTES = reatomRoutes({ | |
auth: { | |
login: {}, | |
registration: {}, | |
}, | |
goods: { | |
':id': { | |
edit: {}, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
type Atom, | |
type Action, | |
type Ctx, | |
type Rec, | |
atom, | |
action, | |
type Fn, | |
type CtxSpy, | |
isCausedBy, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type UrlSearchParamsInit = ConstructorParameters< | |
typeof URLSearchParams | |
>[0]; | |
export interface FetchRequestInit< | |
Result = unknown, | |
Params = unknown, | |
Body = unknown | |
> extends RequestInit { | |
url?: string | URL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fingerprint } from 'src/infrastructure/fingerprint'; | |
import { Client, fetchExchange, makeOperation, mapExchange } from 'urql'; | |
export const client = new Client({ | |
url: '/api/graphql', | |
requestPolicy: 'network-only', | |
exchanges: [ | |
mapExchange({ | |
async onOperation(operation) { | |
return makeOperation(operation.kind, operation, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AsyncAction } from '@reatom/async' | |
import { Atom, atom } from '@reatom/core' | |
export const withReadyAtom = | |
<T extends AsyncAction & { dataAtom?: Atom }>(initState = false) => | |
(anAsync: T): T & { readyAtom: Atom<boolean> } => { | |
// use `spy` to prevent any race conditions | |
const readyAtom = atom((ctx, state?: boolean) => { | |
// trigger connection to start the fetch if `onConnect` used | |
if (anAsync.dataAtom) ctx.spy(anAsync.dataAtom) |
NewerOlder