5.3.0 • Published 1 year ago

react-io v5.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year 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

1 year ago

5.4.0-beta.5

1 year ago

5.4.0-beta.2

2 years ago

5.4.0-beta.3

2 years ago

5.4.0-beta.0

2 years ago

5.4.0-beta.1

2 years ago

5.3.0

2 years ago

5.3.0-beta.0

3 years ago

5.3.0-beta.1

3 years ago

5.2.0

5 years ago

5.1.2

5 years ago

5.1.1

5 years ago

5.1.0

5 years ago

5.1.0-beta.3

5 years ago

5.1.0-beta.1

5 years ago

5.1.0-beta.2

5 years ago

5.1.0-beta.0

5 years ago

5.0.1

7 years ago

5.0.0

7 years ago

4.5.0

7 years ago

4.4.9

7 years ago

4.4.8

7 years ago

4.4.7

7 years ago

4.4.5

7 years ago

4.4.4

8 years ago

4.4.2

8 years ago

4.4.1

8 years ago

4.4.0

8 years ago

4.3.0

8 years ago

4.2.0

8 years ago

4.1.0

8 years ago

4.0.0

9 years ago

3.3.1

9 years ago

3.3.0

9 years ago

3.2.2

9 years ago

3.2.1

9 years ago

3.2.0

9 years ago

3.1.1

9 years ago

3.1.0

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago