Skip to content
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

Updated TypeScript definitions to be compatible with Redux 4 #493

Closed
wants to merge 1 commit into from
Closed

Conversation

codeaid
Copy link

@codeaid codeaid commented Apr 27, 2018

This fixes #492.

@asaed
Copy link

asaed commented May 17, 2018

Do we have an ETA of when this will be merged?

@Lysholm
Copy link

Lysholm commented May 25, 2018

@asaed: If you need this now you can add a file containing this to your typesRoot ("compilerOptions": { "typeRoots": ["./src/types", "./node_modules/@types"]}):

// This is a temporary fix for redux-devtools-extension#492

import {StoreEnhancer} from "redux";

declare module "redux" {
    export type GenericStoreEnhancer = StoreEnhancer;
}

export function composeWithDevTools(options: EnhancerOptions): typeof compose;
export function devToolsEnhancer(options: EnhancerOptions): GenericStoreEnhancer;
export function devToolsEnhancer(options: EnhancerOptions): StoreEnhancer;
Copy link

@alecmev alecmev May 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, mark options as an optional argument? That is, append a ?. It is, in fact, optional, as per the docs and the source code:

} else if (typeof config !== 'object') config = {};

Asking you, @codeaid, instead of making a PR, because it'll likely take several more months to merge it otherwise.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and....

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FDiskas I gave up waiting for maintainer merging this so forked and patched. As temporary solution https://www.npmjs.com/package/redux-devtools-extension-sol

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, @jeremejevs, completely missed your comment! I guess it's irrelevant now anyway seeing how this PR got closed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, @codeaid, this is no showstopper 🙂

@bitflower
Copy link

@Lysholm I get 'StoreEnhancer' is declared but its value is never read. alsthough I've set // tslint:disable-next-line no-unused-vars. Any idea how to solve this?

@AlexGodard
Copy link

@bitflower

I did this:

import * as redux from 'redux';

declare module "redux" {
    export type GenericStoreEnhancer = redux.StoreEnhancer;
}

solshark pushed a commit to solshark/redux-devtools-extension that referenced this pull request Jun 13, 2018
@jhen0409
Copy link
Collaborator

Merged with #495. Sorry I didn't realize this is early than #495. 😅

@jhen0409 jhen0409 closed this Jun 15, 2018
@SergeyKharchenko
Copy link

@jhen0409 when can we expect new version of npm package?

@jhen0409
Copy link
Collaborator

@SergeyKharchenko, I have yet permission for publish the package, so I'm trying to contact with @zalmoxisus.

@jhen0409
Copy link
Collaborator

Published as v2.13.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript declarations incompatible with Redux 4.0