1.2.0 • Published 11 months ago

react-native-fast-api v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

React native fast.com API

A speed test using Fast.com for React Native. Axios is used to make the requests.

Installation

$ npm install --save react-native-fast-api

Api usage

Example:

import ApiSpeed from "react-native-fast-api";
import React, { useState, useEffect } from "react";
import { View, Text } from "react-native";

const App = () => {
  const [resultTest, setResultTest] = useState("");
  const [statusTest, setStatusTest] = useState(true);

  useEffect(() => {
    calculateDownloadSpeed();
  }, []);

  const calculateDownloadSpeed = () => {
    ApiSpeed.calculateSpeed()
      .then((downloadSpeed) => {
        setResultTest(downloadSpeed);
        setStatusTest(false);
        console.log(downloadSpeed);
      })
      .catch((error) => {
        console.error("Erro ao calcular a velocidade de download", error);
      });
  };

  return (
    <View>
      <Text>Resultado do teste: {resultTest}</Text>
      <Text>Status do teste: {statusTest ? "Em andamento" : "Concluído"}</Text>
    </View>
  );
};

export default App;

Feel free to contribute: https://github.com/arnaldobatista/react-native-fast-api

Donate Paypall: arnaldo.carpi@icloud.com

1.2.0

11 months ago

1.1.0

11 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago