-
Notifications
You must be signed in to change notification settings - Fork 114
Pass options to devtools #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For now, I have a fork that makes |
@anilanar Please feel free to send a PR. |
@anilanar what if we create an option to createStore that tells it to not compose with devtools, and you can pass devtools as an enhancer in createStore? |
@navneet-g Devtools' compose function iterates all enhancers and generates an I don't understand why it needs to do that though. So |
Any way I can help here? This is a major hindrance for us using this package now :-/ |
I don’t see a way to make this a non-breaking change. If maintainers are fine with a breaking change, and if they propose the new API, I can make a PR. Otherwise I don’t want to waste time on bikeshedding and on a PR. |
@abettadapur what if we take a compose function as input? @dbartholomae @anilanar will that help? |
Taking a function sounds great! And if enhancers is a function instead of a middleware, dev-tools are not included by default. If this approach is fine, I could try to write a PR. |
I propose:
It might be possible to avoid overloads with some Typescript 3.0+ type-level wizardry: microsoft/TypeScript#26058 (comment) If someone's into it, it may be possible to take a tuple of modules like |
I'm working on this now. |
Any news on the PR? Looking forward to this! |
Sorry I’ve been on a long vacation with no access to computers, will handle this when I’m back.
On 23. Aug 2019, 04:40 +0300, Daniel Bartholomae <[email protected]>, wrote:
Any news on the PR? Looking forward to this!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#65?email_source=notifications&email_token=AAFYASGQKHWPRAPWCKS4RSTQF45ZLA5CNFSM4G36CQF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD463WDI#issuecomment-524139277>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAFYASGZIN7TZ74TNESRPYDQF45ZLANCNFSM4G36CQFQ>.
|
Uh oh!
There was an error while loading. Please reload this page.
Although it is convenient to include devtools integration in this library, there's a fair question to ask here: is it this library's responsibility to do it? If it's done for technical reasons, I think we need a way to pass options to the devtools' compose function.
Particularly action blacklisting, state sanitization, max-age are invaluable for large apps.
In addition, different apps have different needs (e.g. using devtools in production etc.). There are infinitely many possible ways to configure devtools. What if
createStore
took acompose
function as a parameter?Another alternative (as seen in other issues/questions submitted) is to have an additional API that exports enhancers/middlewares for dynamic module management and let users seeking more freedom use
createStore
fromredux
.If you would like to go with the first option (adding compose param to
createStore
), I can make a PR. I suggest thatcreateStore
’s first argument is made an options object in that case e.g.createStore<...>(options: { compose, initialState, enchancersEtc }, ...modules)
. I’m typing from mobile so this is not a type signature 😄It seems it’d be better if this were done after #55 is merged. Nevertheless this will be a breaking change.
The text was updated successfully, but these errors were encountered: