This file contains hidden or 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 { context, Fn, noop, top, wrap } from '@reatom/core'; | |
function takeNested(cb: Fn) { | |
const frame = top(); | |
return new Promise<void>((resolve, reject) => { | |
let i = 1; | |
const check = () => { |
This file contains hidden or 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 { action, atom, Atom, AtomState, withInit } from '@reatom/framework'; | |
import { routerAtom } from 'shared/lib/router'; | |
const isPending = atom(false, 'isPending'); | |
const queue = atom<Array<() => Promise<void>>>([], 'queue'); | |
isPending.onChange((ctx, isPendingValue) => { | |
const queueValue = ctx.get(queue); | |
if (!isPendingValue && queueValue.length > 0) { | |
const update = queueValue[0]; |
This file contains hidden or 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 SuggestItem = { | |
id: string; | |
name: string; | |
}; | |
export type SuggestResource = { | |
suggestsAtom: Atom<Array<SuggestItem>>; | |
loadingAtom: Atom<boolean>; | |
errorAtom: Atom<Error | undefined>; | |
changeSuggestQueryParam: Action<[string]>; |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract ENS { | |
struct Domain { | |
address addr; | |
uint expiresAt; | |
uint price; | |
} |
This file contains hidden or 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 { ref, watch, type Ref } from 'vue' | |
import { useRoute, useRouter, type LocationQueryValue } from 'vue-router' | |
const isPending = ref(false) | |
const queue = ref<Array<() => void>>([]) | |
export function bind(v: Ref<LocationQueryValue | Array<LocationQueryValue>>, name: string) { | |
const router = useRouter() | |
const route = useRoute() |