0.1.10 • Published 10 months ago

@rns-fe/webfetch v0.1.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months 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

10 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.9

11 months ago

0.1.4

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago