0.1.18 • Published 5 months ago

@coralblack/flax v0.1.18

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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.

0.1.18

5 months ago

0.1.17

8 months ago

0.1.16

1 year ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.9

2 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago