Giter VIP home page Giter VIP logo

Comments (12)

vyshkant avatar vyshkant commented on May 2, 2024 5

@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.

vyshkant avatar vyshkant commented on May 2, 2024 1

@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.

Ashoat avatar Ashoat commented on May 2, 2024

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.

vdelacou avatar vdelacou commented on May 2, 2024

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.

Ashoat avatar Ashoat commented on May 2, 2024

Closing due to inactivity

from redux-helpers.

Ashoat avatar Ashoat commented on May 2, 2024

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.

rodrigoelp avatar rodrigoelp commented on May 2, 2024

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.

rodrigoelp avatar rodrigoelp commented on May 2, 2024

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.

Ashoat avatar Ashoat commented on May 2, 2024

Hosting in-package is great! PR welcome :)

from redux-helpers.

rodrigoelp avatar rodrigoelp commented on May 2, 2024

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.

Ashoat avatar Ashoat commented on May 2, 2024

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.

rodrigoelp avatar rodrigoelp commented on May 2, 2024

Will continue the convo in the PR.

from redux-helpers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.