Skip to content

Instantly share code, notes, and snippets.

@chipbite
Created October 14, 2022 09:22
Show Gist options
  • Save chipbite/a440b76d752318f2b509433b1820f229 to your computer and use it in GitHub Desktop.
Save chipbite/a440b76d752318f2b509433b1820f229 to your computer and use it in GitHub Desktop.

Copy reference

NKP-Pocky/Central\KpDataProvider\src\providers\icom\getIcomCacheData.js:34

async function fetchData() {
  const icomData = {};
  try {
    const unstructuredGeometryData = await getGeometryData();
    const scpData = calcScpGroups(unstructuredGeometryData);
    icomData.data = await getStructuredGeometryData(unstructuredGeometryData);
    icomData.scpGroups = mapScalableGroups(scpData);
    // Since icomData might be cached by memoization make sure it does not get mutated.
    return Object.freeze(icomData);

Copy as markdown

Central\KpDataProvider\src\providers\icom\getIcomCacheData.js 43:

sync function fetchData() {
  const icomData = {};
  try {
    // "unstructureddata" could be renamed more specific... @oskarwingardikea
    const unstructuredGeometryData = await getGeometryData();
    const scpData = calcScpGroups(unstructuredGeometryData);
    icomData.data = await getStructuredGeometryData(unstructuredGeometryData);
    icomData.scpGroups = mapScalableGroups(scpData);
    // Since icomData might be cached by memoization make sure it does not get mutated.
    return Object.freeze(icomData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment