Package Exports
- use-async-call
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-async-call) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
use-array-state
A simple helper to makes changes to an array without needing to worry about mutating the value
Install
npm install use-array-stateUseage
import useArrayState from 'use-array-state'
function ArrayComponent () {
const [value, valueActions] = useArrayState()
return (
<div>
<button onClick={() => {valueActions.push('new-value')}}
<pre>
{JSON.stringify(value, null, 2)}
</pre>
</div>
)
}Available actions
See src/index.ts for the the interface, all methods contain docs in types