View promise-based-memoization.ts
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
const LRUCache = (size: number) => { | |
const storage = new Map(); | |
const get = (key: string) => { | |
const value = storage.get(key); | |
if (value) { | |
storage.delete(key); | |
storage.set(key, value); | |
} | |
return value; |
View FilteredRelationship.tsx
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
/** @jsxRuntime classic */ | |
/** @jsx jsx */ | |
import { Fragment, ReactNode, useState } from 'react'; | |
import { Button } from '@keystone-ui/button'; | |
import { Inline, jsx, Stack, useTheme } from '@keystone-ui/core'; | |
import { FieldContainer, FieldLabel, FieldLegend } from '@keystone-ui/fields'; | |
import { DrawerController } from '@keystone-ui/modals'; | |
import { |
View FilteredRelationshipSelect.tsx
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
/** @jsxRuntime classic */ | |
/** @jsx jsx */ | |
import 'intersection-observer'; | |
import { RefObject, useEffect, useMemo, useState, createContext, useContext, useRef } from 'react'; | |
import { jsx } from '@keystone-ui/core'; | |
import { MultiSelect, Select, selectComponents } from '@keystone-ui/fields'; | |
import { validate as validateUUID } from 'uuid'; | |
import { IdFieldConfig, ListMeta } from '@keystone-6/core/types'; |
View material-design-icons.js
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 { resolve } from 'path' | |
const icons = ['Phone', 'Alarm'] | |
export default function () { | |
this.nuxt.hook('components:dirs', (dirs) => { | |
dirs.push({ | |
path: resolve('node_modules/vue-material-design-icons'), | |
prefix: 'MaterialIcon', | |
pattern: `**/@(${icons.join('|')}).vue`, |