-
Notifications
You must be signed in to change notification settings - Fork 31
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
Need to reference the Connect type #101
Comments
Hey there! Are you using Flow or TypeScript? If the latter, you don’t need to explicitly type the return value of createConnectedStore — let TypeScript infer it for you. |
Hey :) I am using Typescript, but for reasons particular to my app I cannot assign the variable straight away. My code is a little something like this: let storeConnect:Connect; // At some point in the future |
Done in 5.1.0. I've renamed import {createConnectedStore, CreateConnectedStore} from 'undux'
let a: CreateConnectedStore<State> = createConnectedStore(...) |
Awesome, thanks! |
I need to reference the return type of createConnectedStore, which is Connect. However it seems that I can only import it from the following location:
import { Connect } from 'undux/dist/src/react/createConnectedStore'
This seems a bit odd to me as it would appear that I am importing a type that is only meant to be referenced internally, and perhaps prone to change?
I am using the Connect type to store the return result like so:
let storeConnect:Connect<StoreProps>; // Don't mind the any ;)
Is there a different type I can reference instead. Or are you able to promote the Connect to the 'undux' location?
The text was updated successfully, but these errors were encountered: