Skip to content
Permalink
Browse files

first commit

adding ci.yml

draft api to handle cascading fetches

license and readme updates
  • Loading branch information
marcellomontemagno committed Nov 20, 2019
0 parents commit b56135a98a485655450c4769aea37692ce7514a1
Showing with 17,222 additions and 0 deletions.
  1. +1 βˆ’0 .eslintrc.js
  2. +26 βˆ’0 .github/workflows/ci.yml
  3. +35 βˆ’0 .gitignore
  4. +2 βˆ’0 .npmignore
  5. +7 βˆ’0 LICENSE
  6. +28 βˆ’0 README.md
  7. +16,640 βˆ’0 package-lock.json
  8. +40 βˆ’0 package.json
  9. +10 βˆ’0 react-scv/webpack.dev.js
  10. +79 βˆ’0 src/CascadingFetchesExample.js
  11. +78 βˆ’0 src/CascadingFetchesProblemExample.js
  12. +32 βˆ’0 src/FetchCallbackExample.js
  13. +51 βˆ’0 src/FetchEffectExample.js
  14. +27 βˆ’0 src/Root.js
  15. +11 βˆ’0 src/app.js
  16. +5 βˆ’0 src/module/Suspend.js
  17. +10 βˆ’0 src/module/awaitResource.js
  18. +7 βˆ’0 src/module/index.js
  19. +62 βˆ’0 src/module/useFetchCallback.js
  20. +20 βˆ’0 src/module/useFetchEffect.js
  21. +50 βˆ’0 src/module/useFetcher.js
  22. +1 βˆ’0 tests/sample.test.js
  23. BIN ufo.png
@@ -0,0 +1 @@
module.exports = require('react-scv/config/eslint.dev.js')
@@ -0,0 +1,26 @@
name: CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: CI
run: |
npm ci
npm run build:umd
npm test
env:
CI: true
@@ -0,0 +1,35 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Coverage
lib-cov
coverage
.coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Dependency directories
node_modules
jspm_packages
bower_components

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Webstorm files
.idea

# build result
build
@@ -0,0 +1,2 @@
.gitignore
node_modules/
@@ -0,0 +1,7 @@
Copyright 2019 Marcello Montemagno

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,28 @@
[![Actions Status](https://github.com/marcellomontemagno/react-ufo/workflows/CI/badge.svg)](https://github.com/marcellomontemagno/react-ufo/actions)

<p align="center">
<img alt="ufo" src='ufo.png'/>
<br/>
UFO - Use fetch orderly
<br/>
react-ufo is a collection of react hooks to help you handle data fetching with no fuss
</p>

## Disclamer

These APIs are experimental and there might be some API change before a stable version is released.
Use the unstable version at your own risk.

## Installation

`npm install --save react-ufo`

## Examples

If you want to invoke a remote API inside an event callback: <a href="https://github.com/marcellomontemagno/react-ufo/blob/master/src/FetchCallbackExample.js" target="_blank">Fetch Callback Example</a><br/>
If you want to invoke a single API on mount/update: <a href="https://github.com/marcellomontemagno/react-ufo/blob/master/src/FetchEffectExamplele.js" target="_blank">Fetch Effect Examplele</a><br/>
If you want to invoke multiple APIs depending on each other: <a href="https://github.com/marcellomontemagno/react-ufo/blob/master/src/CascadingFetchesExample.js" target="_blank">Cascading Fetches Example</a><br/>
## Dependencies
This package has zero dependencies but in order to support fetches abortion you will need <a href="https://developer.mozilla.org/en-US/docs/Web/API/AbortController" target="_blank">AbortController</a> (or a polyfill such as <a href="https://www.npmjs.com/package/abortcontroller-polyfill" target="_blank">abortcontroller-polyfill</a>) in your environment

0 comments on commit b56135a

Please sign in to comment.
You can’t perform that action at this time.