Skip to content

Releases: klis87/normy

@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.

@normy/core v0.7.0

24 Jun 20:10
Compare
Choose a tag to compare

Renamed getNormalisationObjectKey option into getNormalizationObjectKey.

@normy/react-query v0.7.0

30 Mar 20:41
Compare
Choose a tag to compare
  • refactored createNormalizedQueryClient into createQueryNormalizer - it is not only about the name, but mostly createQueryNormalizer does not create react-query client for you, you need to do it yourself and pass instance to createQueryNormalizer, for example:

    const queryClient = new QueryClient();
    
    createQueryNormalizer(queryClient);
  • added possibility to clear normalized data and unsubscribe from future updates, for example:

    const normalizer = createQueryNormalizer(queryClient);
    
    normalizer.clear();

@normy/core v0.6.0

30 Mar 20:35
Compare
Choose a tag to compare

Added clearNormalized, so it is possible now to clear all normalized data. You can use it like this:

const normalizer = createNormalizer(normalizerConfig);

normalizer.clearNormalizedData();