tgapi
Version:
Actual Telegram bot API with Rx-driven updates and full Flow type coverage
19 lines (14 loc) • 416 B
JavaScript
/* @flow */
import { getSet } from '../util'
import type { Result } from './types'
export type APIRequest = {
token: string,
method: string,
url: string,
body?: FormData,
}
type UserCallMethod = (apiRequest: APIRequest) => Promise<Result<any>>
export const [getToken, setToken] = getSet<string>('token')
export const [getUserCallMethod, setUserCallMethod] = getSet<UserCallMethod>(
'userCallMethod',
)