UNPKG

@applicaster/zapp-react-native-ui-components

Version:

Applicaster Zapp React Native ui components for the Quick Brick App

48 lines (37 loc) 938 B
import * as R from "ramda"; export const entryContext = { id: "entryId", title: "Entry", extensions: { prop: "value", }, }; export const searchContext = "search query"; export const screenContext = { id: "screenId", name: "Screen name", }; export const navigator = { currentRoute: "/river/A1234", }; export const screenData = { id: "screenDataId", name: "name from screen data", }; const component = {}; const setDatasource = (comp, index) => ({ ...comp, data: { source: `http://datasource${index}` }, rules: { clear_cache_on_reload: index === 12 || index === 20 }, }); const ui_components = new Array(25).fill(component).map(setDatasource); export const river = { id: "A1234", ui_components, }; export const riverDataSources = R.compose( R.splitEvery(10), R.map(R.path(["data", "source"])), R.reject(R.pathEq(["rules", "clear_cache_on_reload"], true)), R.prop("ui_components") )(river);