manaflair / redux-batch

Enhance your Redux store to support batched actions
171 stars 12 forks source link

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

Open hackhat opened 6 years ago

arcanis commented 6 years ago

Can you send a PR? Thanks :)

On Tue, Aug 14, 2018, 8:06 AM Hack Hat notifications@github.com 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 .

hackhat commented 6 years ago

I will try later.

arcanis commented 5 years ago

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

cmfcmf commented 5 years ago

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.

arcanis commented 5 years ago

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

cmfcmf commented 5 years ago

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.