UNPKG

@applicaster/zapp-react-native-utils

Version:

Applicaster Zapp React Native utilities package

25 lines (16 loc) 600 B
import * as R from "ramda"; export const getIdProp = R.compose(encodeURIComponent, R.prop("id")); export const getRiverId = R.cond([ [R.has("riverId"), R.prop("riverId")], [R.has("screen_type"), R.prop("screen_type")], [R.T, getIdProp], ]); export const getMenuItemId = R.path(["data", "target"]); export const getArticleId = getIdProp; export const getPlayableId = getIdProp; export const getContentScreenId = getIdProp; export const getUrlSchemeId = R.compose(encodeURIComponent, R.prop("url")); export const getLinkId = R.compose( encodeURIComponent, R.path(["link", "href"]) );