UNPKG

drnaf

Version:

Dynamic React-Native Application Framework

36 lines (31 loc) 811 B
import axios from 'axios' export function post(url, request, options = { callback: null, }) { axios.post(url, request) .then(function (response) { // jck callback(options, { status: true, message: 'successfully', response: response, data: response.data }); }) .catch(function (error) { console.log(error); // jck callback(options, { status: false, message: 'network failed', data: null, }) }); } export const foo = Math.PI + Math.SQRT2; /** local methods */ function callback(options, val) { if (!options.callback) return; // callback options.callback(val) }