@szmg-fe/tarco
Version:
function library in Taro
19 lines (16 loc) • 492 B
text/typescript
/*
* @Description: get openid
* @Date: 2021-04-01 10:32:43
* @Author: Lemon
* @LastEditTime: 2021-05-08 15:20:14
*/
import { compose, curry, map } from "@szmg-fe/funba/ramda";
import prop from '@szmg-fe/funba/prop'
/**
* curry func -> func(http is a function which receive appId and jsCode) -> task
*/
const getOpenId = curry((http, appId, code) => {
const collect = () => ({ appId, code });
return compose(map(prop('openid')), http, collect)();
});
export default getOpenId