redux-batch icon indicating copy to clipboard operation
redux-batch copied to clipboard

Can you please add @types/@manaflair/redux-batch ? thanks

Open hackhat opened this issue 7 years ago • 6 comments

hackhat avatar Aug 14 '18 07:08 hackhat

Can you send a PR? Thanks :)

On Tue, Aug 14, 2018, 8:06 AM Hack Hat [email protected] wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/manaflair/redux-batch/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_Wa8OZ_qGYYNJNiHS4e_ji8209H2OWks5uQnbtgaJpZM4V75i4 .

arcanis avatar Aug 14 '18 08:08 arcanis

I will try later.

hackhat avatar Aug 14 '18 09:08 hackhat

@mpash would you mind minding your own business? Do you have stock shares in redux-saga? /s

arcanis avatar Jan 17 '19 17:01 arcanis

To bring this back to topic, here is the definition I currently use:

declare module "@manaflair/redux-batch" {
  import { AnyAction, StoreEnhancer } from "redux";

  export const reduxBatch: StoreEnhancer<{
    dispatch: (actions: AnyAction[]) => AnyAction[],
  }>;
}

It is neither polished nor well tested, but works for me and could serve as a starting point for adding definitions in the future.

cmfcmf avatar Jan 17 '19 17:01 cmfcmf

@cmfcmf Thanks! I've added it and published a 1.0.0 - can you try and let me know if it works as you would expect?

arcanis avatar Jan 17 '19 19:01 arcanis

Whew! That was fast. :tada: The definitions work fine, except for one minor thing I overlooked when creating them: There is no way to specify the action type with these definitions, because I set them to AnyAction. I came up with a backwards-compatible extension which allows to specify the action type in #20.

cmfcmf avatar Jan 20 '19 14:01 cmfcmf