MCPcopy Index your code
hub / github.com/formatjs/formatjs / fetchData

Function fetchData

packages/editor/index.tsx:30–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29const MESSAGES_COUNT = 50
30async function fetchData(): Promise<TranslatedMessage[]> {
31 const en = await (await fetch('/fixtures/en.json')).json()
32 const ru = await (await fetch('/fixtures/ru.json')).json()
33 return Object.keys(en)
34 .slice(MESSAGES_COUNT)
35 .map(id => ({
36 id,
37 defaultMessage: (en as any)[id],
38 translatedMessage: (ru as any)[id],
39 }))
40}
41
42export function CoreApp() {
43 const intl = useIntl()

Callers 1

CoreAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected