Skip to content

Conversation

@dleitee
Copy link
Owner

@dleitee dleitee commented Jun 24, 2018

TODO:

  • Request must have a children's prop as a function
  • Do a request and call the children's function
    • when start a promise, we should call the children's function with loading = true
    • when promise resolves, we should call the children's function with data = {} or null, error = {} or null and loading = false
  • Abort all Promises when componentDidUnmount
  • Request must receive these props listed below:
    • uri
    • uri as array
    • config (fetch config)
    • method
    • data
    • skip
      • we should return a call of children's function without params
    • delay
      • we should use setTimeout to make the delay.
      • we should terminate the setTimeout when componentDidUnmount
    • pollInterval
      • we should use setInterval to make the pollInterval.
      • we should terminate the setInterval when componentDidUnmount
    • cachePolicy
<Request uri="friends" method="GET">
  {({ loading, error, data }) => {
    if (loading) {
      return "Loading..."
    }
    if (error) {
      return `Error: ${error.message}`
    }

     return (
        <select name="friend" onChange={onFriendSelected}>
          {data.friends.map(friend => (
            <option key={friend.id} value={friend.id}>
              {friend.name}
            </option>
          ))}
        </select>
      )
  }}
</Request>

greenkeeper bot and others added 19 commits June 19, 2018 04:21
Update rollup to the latest version 🚀
…-4.0.1

Greenkeeper/react testing library 4.0.1
…4.0.0

Update react-testing-library to the latest version 🚀
…17.0.0

Update eslint-config-airbnb to the latest version 🚀
Update eslint to the latest version 🚀
Update rollup to the latest version 🚀
Update fetches to the latest version 🚀
@dleitee dleitee force-pushed the feature/request-component branch from 421a97b to fb77dcc Compare July 1, 2018 12:34
@codecov
Copy link

codecov bot commented Jul 1, 2018

Codecov Report

Merging #15 into version/2.0.0 will decrease coverage by 3.59%.
The diff coverage is 90.9%.

Impacted file tree graph

@@               Coverage Diff                @@
##           version/2.0.0      #15     +/-   ##
================================================
- Coverage          96.82%   93.23%   -3.6%     
================================================
  Files                  6        8      +2     
  Lines                 63      133     +70     
  Branches               9       17      +8     
================================================
+ Hits                  61      124     +63     
- Misses                 2        9      +7
Impacted Files Coverage Δ
src/connect.js 95.83% <100%> (+0.59%) ⬆️
src/context.js 100% <100%> (ø) ⬆️
src/components/request/index.js 100% <100%> (ø)
src/provider.js 71.42% <66.66%> (-28.58%) ⬇️
src/components/request/wrapper.js 90.9% <90.9%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d70e2e7...f1169d1. Read the comment docs.

@dleitee dleitee force-pushed the feature/request-component branch from f6d6df3 to 0f866b2 Compare July 1, 2018 13:49
@dleitee dleitee self-assigned this Jul 1, 2018
@dleitee dleitee force-pushed the feature/request-component branch from 0662186 to fd4996a Compare July 1, 2018 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants