UNPKG

@szmg-fe/tarco

Version:

function library in Taro

19 lines (16 loc) 594 B
/* * @Description: login for phone * @Date: 2021-04-01 10:34:23 * @Author: Lemon * @LastEditTime: 2021-04-08 15:19:41 */ 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 encryptedData and iv and openId) -> task */ const loginForPhone = curry((http, appId: string, encryptedData: string, iv: string, openId: string) => { const collect = () => ({ appId, encryptedData, iv, openId }); return compose(map(prop('token')), http, collect)(); }); export default loginForPhone;