MCPcopy Create free account
hub / github.com/chart-kit/react-native-chart-kit-example / getPresetFromParams

Function getPresetFromParams

src/showcase/navigation.ts:102–110  ·  view source on GitHub ↗
(
  params: ShowcaseSearchParams | null | undefined,
)

Source from the content-addressed store, hash-verified

100): ShowcaseThemeMode => (params?.get("theme") === "dark" ? "dark" : "light");
101
102export const getPresetFromParams = (
103 params: ShowcaseSearchParams | null | undefined,
104): ShowcasePresetId => {
105 const preset = params?.get("preset");
106
107 return presetIds.has(preset as ShowcasePresetId)
108 ? (preset as ShowcasePresetId)
109 : "default";
110};

Callers 3

getInitialPresetFunction · 0.90
AppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected