@coralblack/flax
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.8 • Public • Published

    flax

    flax

    flax is consists of components that help you invoke HTTP API super-simply.

    Installation

    npm install --save @coralblack/flax

    Usage

    import 'flax/dist/styles/index.css';
    import {FxButton, FxGuard} from 'flax';

    FxGuard

    A component that makes it super simple to HTTP API inquiry requests.

    <FxGuard
      api={{
        method: 'GET',
        url: 'https://jsonplaceholder.typicode.com/todos/1',
      }}
      render={data => (
        <>
          <div>
            <label>userId:</label> {data.userId}
            <br />
            <label>id:</label> {data.id}
            <br />
            <label>title:</label> {data.title}
          </div>
        </>
      )}
    />

    FxButton

    A component that makes it super simple to HTTP API invoke requests.

    <FxButton
      label="Post"
      api={{
        method: 'POST',
        url: 'https://jsonplaceholder.typicode.com/posts',
      }}
      success={(res) => document.location.href = '/posts/' + res.id}
      error=((err) => Message.show(`An error has occurred. (${err.message})`))
    />

    Author

    License

    MIT. Copyright © 2020 CORAL.BLACK.

    Keywords

    none

    Install

    npm i @coralblack/flax

    DownloadsWeekly Downloads

    300

    Version

    0.1.8

    License

    MIT

    Unpacked Size

    137 kB

    Total Files

    26

    Last publish

    Collaborators

    • why2pac