Skip to content

Releases: klis87/normy

@normy/react-query v0.12.0

13 Nov 10:49
Compare
Choose a tag to compare

Added getObjectById and getQueryFragment functions. You can use getObjectById to get an object from normalized store by id. With getQueryFragment you can get multiple objects by id.

See https://github.com/klis87/normy/tree/master/packages/normy-react-query#getobjectbyid-and-getqueryfragment-arrow_up for potential usage.

@normy/core v0.8.0

13 Nov 10:48
Compare
Choose a tag to compare

Added getObjectById and getQueryFragment functions. You can use getObjectById to get an object from normalized store by id. With getQueryFragment you can get multiple objects by id.

See https://github.com/klis87/normy/tree/master/packages/normy-react-query#getobjectbyid-and-getqueryfragment-arrow_up for potential usage.

@normy/react-query v0.11.2

01 Nov 22:03
Compare
Choose a tag to compare

This is the same as 0.11.1 - released to fix latest issues with npm.

@normy/react-query v0.11.1

01 Nov 21:57
Compare
Choose a tag to compare

Updated @normy/core to 0.7.2 to fix issues with Date objects.

@normy/react-query v0.10.1

01 Nov 21:59
Compare
Choose a tag to compare

Updated @normy/core to 0.7.2 to fix Date support.

@normy/core v0.7.2

01 Nov 21:55
Compare
Choose a tag to compare

Fix missing Date support, now your data can have Date objects and normalization will work fine. Thanks @garrettg123 for creating the issue.

@normy/react-query v0.11.0

30 Oct 22:15
Compare
Choose a tag to compare

Updated to work with react-query: 5. This also works with work in progress trpc: 11, for example with 11.0.0-next.92.

There are no breaking changes with this release, however note, that if you still use react-query: 4, you must use @normy/react-query v0.10.0!

@normy/react-query v0.10.0

29 Oct 23:08
Compare
Choose a tag to compare

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>
  );
};

@normy/react-query v0.9.0

22 Jul 21:50
Compare
Choose a tag to compare

Added a new way to initialize normalized store. Now you do this with QueryNormalizerProvider, for example:

<QueryNormalizerProvider
  queryClient={queryClient}
  normalizerConfig={{ devLogging: true }}
>
  <QueryClientProvider client={queryClient}>
    <App />
  </QueryClientProvider>
</QueryNormalizerProvider>

The new way has the advantage that normalized store is cleared automatically after QueryNormalizerProvider is unmounted.

Another advantage is that next release will get a new normalized method to update data, for which new context reader to get normalized store instance anywhere will become handy.

@normy/react-query v0.8.0

24 Jun 20:12
Compare
Choose a tag to compare

Renamed getNormalisationObjectKey option into getNormalizationObjectKey.