question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose dispatch action type constants

See original GitHub issue

Feature Request

Describe the suggestion or request in detail

In webchat customization scenarios, to set dispatch events or to intercept events using a middleware, the type has to be set to a string like WEB_CHAT/SET_TEXT. It would be great if you could expose the list of supported events as part of a constant so that we don’t have strings sprayed across the project and devs can check which events are supported. Also, If the text associated with a particular event is changed here for some reason, devs wouldn’t have to update it in their projects too.

[Enhancement]

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tdurnfordcommented, Aug 30, 2019

It might also be nice to expose some of the action functions as well.

import { sendEvent, sendMessage, sendMessageBack } from 'botframework-webchat-core'

...

store.dispatch(sendMessage('Hello, World!')); 

However, we probably don’t want to expose some of the action functions such as the connection and speech related actions.

0reactions
cwhittencommented, Feb 26, 2021

Loading this up for discussion and prioritization for an upcoming release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Action Constants - React - LearnHowToProgram.com
In this lesson, we'll make another small refactor to use action constants. So far, all of our action types have been strings.
Read more >
Strings vs constants for Redux action types - Stack Overflow
Same as PropTypes are redundant in typescript, the action constants are redundant. The reason for constants in redux actions is to avoid ...
Read more >
Solution for simple action creation without string constants and ...
I was little annoyed by string constants as action types. And write solution for this, need for objective criticism and ideas.
Read more >
Refactor to use Action Type Constants and Action Creators ...
This lesson covers the use of action type constants and action creators. Action type constants are common in legacy redux apps, ...
Read more >
Redux FAQ: Code Structure
Rails-style: separate folders for “actions”, “constants”, “reducers” ... possibly with sub-folders per file type; “Ducks/Slices”: similar to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found