@applicaster/zapp-react-native-ui-components
Version:
Applicaster Zapp React Native ui components for the Quick Brick App
17 lines (12 loc) • 477 B
JavaScript
import * as R from "ramda";
import { createContext } from "@applicaster/zapp-react-native-utils/reactUtils/createContext";
const PLAYER_CONTENT_PROPERTY = "playerContent";
const initialContext = { playerContent: null };
const stateValidator = R.both(
R.compose(R.equals(PLAYER_CONTENT_PROPERTY), R.prop("property")),
R.compose(R.either(R.is(Object), R.isNil), R.prop("value"))
);
export const PlayerContentContext = createContext(
initialContext,
stateValidator
);