@normy/react-query v0.10.0
·
95 commits
to master
since this release
Until this time, the only way your data could be updated was as a reaction to API response. Now, there is a way to update the data manually. One of the best use case for this is reacting to a websocket notification that a given object was updated. You can use it as below:
import { useQueryNormalizer } from '@normy/react-query';
const SomeComponent = () => {
const queryNormalizer = useQueryNormalizer();
return (
<button
onClick={() =>
queryNormalizer.setNormalizedData({ id: '1', name: 'Updated name' })
}
>
Update user
</button>
);
};