0.6.1 • Published 12 months ago

telemed-api-layer v0.6.1

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

telemed-api

api

Installation

npm install telemed-api

Usage

Wrap your application around APIProvider

import { APIProvider } from 'telemed-api';
// ...

return (
  <APIProvider>
    <YourApp />
  </APIProvider>
);

Update the environment

import { useClient } from 'telemed-api';
// ...

const { setEnvironment } = useClient();

React.useEffect(() => {
  setEnvironment('dev'); // Possible environments are dev/qa/prod/sit/test
  // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Read this value from the environment variable you can set in the UI layer

Custom hooks usage

import { ConsultationError, useConsultationInfo } from 'telemed-api';
// ...

const consultationId = '63db9806d672cb123fdb01ad';

const { data, isLoading, isError, error, refetch } =
  useConsultationInfo(consultationId);

In this way you can get details about any consultation using consultationId. You can use respective attributes to show appropriate UI in UI layer
e.g.
-  isLoading indicates the api call is in progress
-  isError indicates the api call failed and there is an error
-  error is the error received from server
-  data is the object which will be undefined when api call is in progress, and once api call is executed successfully it will be containing all the attribute related to consultation

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.6.1

12 months ago

0.6.0

12 months ago

0.5.9

12 months ago

0.5.8

12 months ago

0.5.7

12 months ago

0.5.6

12 months ago

0.5.5

12 months ago

0.5.4

12 months ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.9

1 year ago

0.4.8

1 year ago

0.4.6

1 year ago

0.4.5

1 year ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.9

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago