0.1.10 • Published 2 years ago

@rns-fe/webfetch v0.1.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

webFetch

apis for rns proj

Usege

  1. setting config data as follow
/*
    getLanguage?: () => string;     // get current language must be a func else is default 'en'
    baseUrl?: () => string;         // get base request url
    showMessage?: (content: string, type: string | 'success' | 'error' | 'normal' | 'warning') => void;             // set how to display error message
    noAuth?: () => void;            // when auth error will call this
    getToken?: () => string;        // get system token
    timeOutInterval?: number;       // get time out interval default 60s
    needLog?: boolean;              // whether need log
    headers?: () => RawAxiosRequestHeaders; // request headers
*/
 setConfigData({
    getLanguage: () => 'jp',
    getToken: () => state.user.token,
    baseUrl: () => Config.API_URL!,
    needLog: Config.ENV == 'dev',
    noAuth: () => dispatch({ type: userActions.logout, payload: { token: null } })
    headers: () => {return {sign: md5string, udid: udidstring}}
  })
  1. call api when use
import { idendtfyService } from '@rns/webfetch'

idendtfyService.identityCard().then((res) => {
                // success
            }).catch((e: any) => {
                // fail
            })

Build

// call build
0.1.10

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago