5.3.0 • Published 3 months ago

react-io v5.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 months ago

react-io

React bindings for url-io Request and mutate data using a standard interface passed through React context.

Passing IO through context

Adds IO to context. Use once at the root of your app.

import React from 'react'
import {IOProvider} from 'react-io'
import io from './io'

export default function App() {
  return <IOProvider io={io}>
    ...
  </IOProvider>
}

withIO(urls)(WrappedComponent)

Returns a higher-order-component (HOC) that pulls io from context and passes it to the wrapped component as a prop.

Pass it a map of urls or a mapper to turn props into a map of urls and it will add the resolved values to the prop stream.

import {withIO, render} from 'react-io'

export default withIO({
  auth: '/auth'
})(function Widget({io, auth}) {
  return auth ?
    <div>{auth.username}</div>) :
    <div>Not authorized</div>
})
5.4.0-beta.4

3 months ago

5.4.0-beta.5

3 months ago

5.4.0-beta.2

8 months ago

5.4.0-beta.3

8 months ago

5.4.0-beta.0

8 months ago

5.4.0-beta.1

8 months ago

5.3.0

11 months ago

5.3.0-beta.0

2 years ago

5.3.0-beta.1

2 years ago

5.2.0

4 years ago

5.1.2

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago

5.1.0-beta.3

4 years ago

5.1.0-beta.1

4 years ago

5.1.0-beta.2

4 years ago

5.1.0-beta.0

4 years ago

5.0.1

5 years ago

5.0.0

6 years ago

4.5.0

6 years ago

4.4.9

6 years ago

4.4.8

6 years ago

4.4.7

6 years ago

4.4.5

6 years ago

4.4.4

7 years ago

4.4.2

7 years ago

4.4.1

7 years ago

4.4.0

7 years ago

4.3.0

7 years ago

4.2.0

7 years ago

4.1.0

7 years ago

4.0.0

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.2

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.1

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago