Comments (12)
@Ashoat What inactivity do you mean? What do you think about the code above? What if I write a PR providing this code in .d.ts
file?
from redux-helpers.
@rodrigoelp Could you please take a look at my PR (#17)? I have slightly changed your code (mostly added exports from other files). Feel free to review it!
from redux-helpers.
Keeping the types within the repo is what I do with Flow, even though we use flow-typed
for the mainline react-navigation
package. I'll defer to you on where to place it for TypeScript. PRs are welcome! :)
from redux-helpers.
For helping you, the typescript definition is :
declare module 'react-navigation-redux-helpers' {
import { NavigationState } from 'react-navigation';
import { Middleware } from 'redux';
export function createReactNavigationReduxMiddleware<S>
(key: string, navStateSelector: (state: S) => NavigationState): Middleware;
export function createReduxBoundAddListener(key: string): void;
}
from redux-helpers.
Closing due to inactivity
from redux-helpers.
PR definitely welcome! We have a couple new exports now (four in total), so any libdef would need to cover all four.
from redux-helpers.
Just to add to the "activity" part. 👍 to @vdelacou for providing the type definition or whoever producing the PR and I don't want to steal somebody else's thunder.
What are you going to do then? I will vote to keep the type definition within the project as opposed to DefinitelyTyped.
from redux-helpers.
By the way, just noticed the type provided is wrong as it does not allow me to create a listener... so I have fixed it here:
declare module 'react-navigation-redux-helpers' {
import { NavigationState, NavigationEventCallback, NavigationEventSubscription } from 'react-navigation';
import { Middleware } from 'redux';
// This was the part that was missing.
type Listener = (eventName: string, callback: NavigationEventCallback) => NavigationEventSubscription;
export function createReactNavigationReduxMiddleware<S>
(key: string, navStateSelector: (state: S) => NavigationState): Middleware;
// So, createReduxBoundAddListener can match the signagure expected
// when creating a 'navigation' object.
export function createReduxBoundAddListener(key: string): Listener;
}
from redux-helpers.
Hosting in-package is great! PR welcome :)
from redux-helpers.
I know @Ashoat, I do want to give the opportunity to @vdelacou as he was the one posted the original declaration. If nothing happens in two or three days, then I will create the PR and send it
from redux-helpers.
Thanks @vyshkant for putting up a PR!! @vyshkant has listed a couple questions on his PR, but I'm not very familiar with TypeScript, so would be great if anybody else on this thread who is familiar could join the discussion on that PR.
from redux-helpers.
Will continue the convo in the PR.
from redux-helpers.
Related Issues (20)
- Issues in ThemeProvider HOT 3
- this .setState does'nt work in componnent didmount anyone can help me? HOT 3
- Is @react-navigation/core needed? v4.0.1 HOT 3
- Invariant Violation: App.router must be provided to createNavigationPropConstructor as of [email protected] HOT 2
- NavState missing routes
- React Nav 5 support - undefined is not object _core.NavigationActions.init HOT 7
- When will react-navigation-5 be adapted? HOT 2
- undefined is not object _core.NavigationActions.init HOT 2
- TypeError: undefined is not an object (evaluating 'Navigator.router')
- React navigation navigation.getChildNavigation is not a fucntion HOT 1
- createReactNavigationReduxMiddleware called more than once
- Cannot read property 'routes' of undefined HOT 2
- TypeScript typings rely on nonexistent @react-navigation/core libdefs HOT 4
- Typings error HOT 2
- Upgrading react-navigation from 1.0.0-beta.13 to latest, having trouble re-integrating my nested navigators with redux. HOT 3
- Cannot read property 'routes' of undefined - react-navigation 3.11, redux-helper 3.0.2 HOT 1
- createNavigationReducer on Web HOT 1
- Upgrading from 1.0.0-beta.21 to v4, gives navigation.getChildNavigation is not a function HOT 3
- Invariant Violation HOT 5
- Changing imports from @react-navigation/core to react-navigation breaks web apps HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-helpers.