From 648d39bc72426d1772633acd48909b953d474672 Mon Sep 17 00:00:00 2001 From: Connor Burton Date: Wed, 4 Aug 2021 16:57:57 +0100 Subject: [PATCH] docs: fixing link to RFC-6902 & fixing typo (#830) --- website/docs/patches.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/patches.mdx b/website/docs/patches.mdx index 6cc0c207..d6b175b1 100644 --- a/website/docs/patches.mdx +++ b/website/docs/patches.mdx @@ -118,7 +118,7 @@ expect(state).toEqual({ }) ``` -The generated patches are similar (but not the same) to the [RFC-6902 JSON patch standard](http://tools.ietf.org/html/rfc6902), except that the `path` property is an array, rather than a string. This makes processing patches easier. If you want to normalize to the official specification, `patch.path = patch.path.join("/")` should do the trick. Anyway, this is what a bunch of patches and their inverse could look like: +The generated patches are similar (but not the same) to the [RFC-6902 JSON patch standard](https://datatracker.ietf.org/doc/html/rfc6902/#section-4.1), except that the `path` property is an array, rather than a string. This makes processing patches easier. If you want to normalize to the official specification, `patch.path = patch.path.join("/")` should do the trick. Anyway, this is what a bunch of patches and their inverse could look like: ```json [ @@ -138,7 +138,7 @@ The generated patches are similar (but not the same) to the [RFC-6902 JSON patch ] ``` -⚠ Note: The set of patches generated by Immer should be correct, that is, applying them to an equal base object should result in the same end state. However Immer does not guarantee the generated set of patches will be optimal, that is, the minimum set of patches possible. It depends often on the use case what is considered 'optimal', and generating the optimal set of patches is potentielly computationally very expensive. So in cases you might want to post process the generated patches, or compress them as explained below. +⚠ Note: The set of patches generated by Immer should be correct, that is, applying them to an equal base object should result in the same end state. However Immer does not guarantee the generated set of patches will be optimal, that is, the minimum set of patches possible. It depends often on the use case what is considered 'optimal', and generating the optimal set of patches is potentially computationally very expensive. So in cases you might want to post process the generated patches, or compress them as explained below. ### `produceWithPatches`