platform icon indicating copy to clipboard operation
platform copied to clipboard

Add actionCreators to StoreDevToolsOptions

Open devkirr opened this issue 2 years ago • 6 comments

Which @ngrx/* package(s) are relevant/related to the feature request?

store-devtools

Information

As instructed by Chrome Redux devtools extension, we can add our built-in actions creators to devtools to be able to manually dispatch them afterward.

It would be nice to include that feature in NgRx StoreDevTools.

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

  • [ ] Yes
  • [x] No

devkirr avatar Sep 05 '23 16:09 devkirr

Can work on that if there interest in adding that option.

va-stefanek avatar Sep 18 '23 14:09 va-stefanek

Hi, yeah it could be a great tool for testing/debugging purpose! I’m sure that people would love that. Writing each time new action in json format is quite boring.Thank you!David QuirionLe 18 sept. 2023 à 10:44, Mateusz Stefańczyk @.***> a écrit : Can work on that if there interest in adding that option.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

devkirr avatar Sep 18 '23 16:09 devkirr

@va-stefanek feel free to pick this one up if you'd like that.

timdeschryver avatar Sep 20 '23 17:09 timdeschryver

@timdeschryver @devkirr, I would appreciate your input on the following matter.

I have conducted some investigation, and by the end of the day, what we would be able to achieve is displaying the expected property for dispatching an action, which is just 'props.' However, we wouldn't have information about what exactly this 'props' consists of and what kind of parameters it expects.

Take the following code as an example:

export const loadBook = createAction(
  '[Book Exists Guard] Load Book',
  props<{ book: Book }>()
);

This code would be evaluated to something like the image shown below: image

This limitation is not specific to NgRx but rather general limitation. We are currently unable to extract the argument type to properly display what kind of parameters a given action accepts.

Please let me know if you find this limitation acceptable and if it adds value to your work in its current form.

va-stefanek avatar Oct 12 '23 06:10 va-stefanek

Thanks for the investigation. If I understood correctly, I’ll be able to see in a sort of dropdown all my NgRx actions with a props input if the action as one configured? Well of course the name/typing of props would be fantastic but just without having to copy/format the action with the proper name and props in a json string would be a great improvement.

devkirr avatar Oct 15 '23 18:10 devkirr

Any progress here? @va-stefanek raw js object-like input would be OK for the first implementation. Hope you can help the whole community with it 🙏

xepozz avatar Apr 02 '24 18:04 xepozz