From 9948a841b7a3dac17dc0c24fb347baf5f2b2ab72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Mon, 15 Jul 2019 11:44:38 +0200 Subject: [PATCH] docs: document redux store wart --- website/src/docs/stores.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/src/docs/stores.md b/website/src/docs/stores.md index 632b4373a..abd9a57cd 100644 --- a/website/src/docs/stores.md +++ b/website/src/docs/stores.md @@ -94,11 +94,14 @@ If you'd rather not store the Uppy state under the `state.uppy` key at all, use const uppy = Uppy({ store: ReduxStore({ store: store, + id: 'avatarUpload', selector: state => state.pages.profile.uppy.avatarUpload }) }) ``` +Note that when specifying a custom selector, you **must** also specify a custom store ID. The store `id` tells the reducer in which property it should put Uppy's state. The selector must then take the state from that property. In the example, we set the ID to `avatarUpload` and take the state from the `[reducer mount path].avatarUpload`. + If your app uses [`reselect`](https://npmjs.com/package/reselect), its selectors work very well with this! ## Implementing Stores