Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle dispatch of message type from devtools #71

Open
joprice opened this issue Nov 12, 2024 · 2 comments
Open

handle dispatch of message type from devtools #71

joprice opened this issue Nov 12, 2024 · 2 comments

Comments

@joprice
Copy link

joprice commented Nov 12, 2024

Description

The redux devtools allow triggering actions from the UI, but the only message type currently handled by the elmish debugger is MsgTypes.Dispatch. I was able to modify the debugger code to support his by adding an inflater argument for the 'msg type:

| msg when msg.``type`` = MsgTypes.Action ->
          let msg: 'msg = msgInflater (JS.JSON.parse (!!msg.action))
          dispatch (msg)

I'm not very familiar with redux tooling, so not sure there's anything else to handle besides this, but this is enough to allow me to trigger side actions manually to easily reproduce side-effects.

@joprice
Copy link
Author

joprice commented Nov 13, 2024

I noticed the actionCreators config option that lets you provide a set of preconfigured values for sending actions, and it seems that it structures the actions in a way that are different than the serialized form. I'd like to make use of that, so I think my above suggestion is too naive.

@MangelMaxime
Copy link
Member

Hello,

If the above improve the current situation and don't break anything personally I am ok with adding it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants