Construct a DevExtreme ArrayStore from an array and keep it in sync when the array changes.
npm install --save @gdrbyko1/react-use-devextreme-arraystore
dxArrayStore = useDxArrayStore(items: any[], key: string)
The key
parameter specifies the name of the property which can be used to uniquely identify an object in the array.
The hook will take care of pushing updates to the ArrayStore whenever the array changes.
import * as React from 'react'
import { useDxArrayStore } from '@gdrbyko1/react-use-devextreme-arraystore'
const Example = () => {
const dxArrayStore = useDxArrayStore([], 'keyField')
return (
<div>
todo
</div>
)
}
MIT © gdrbyKo1
This hook is created using create-react-hook.