WebChat的“存储”对象有什么作用?

问题描述

对于在Health Bot Container Sample处找到的以下javascript代码段(从window.WebChat.createStore创建的“商店”对象),“商店”对象有什么作用? “存储”对象的目的是什么?

我正在阅读web chat api documentation,但是“存储”对象的描述和解释不清楚。

非常感谢您在此问题上的帮助。

const store = window.WebChat.createStore({},function(store) { return function(next) { return function(action) {
    if (action.type === 'DIRECT_LINE/CONNECT_FULFILLED') {
        store.dispatch({
            type: 'DIRECT_LINE/POST_ACTIVITY',meta: {method: 'keyboard'},payload: {
                activity: {
                    type: "invoke",name: "InitConversation",locale: user.locale,value: {
                        // must use for authenticated conversation.
                        jsonWebToken: jsonWebToken,// Use the following activity to proactively invoke a bot scenario
                        /*
                        triggeredScenario: {
                            trigger: "{scenario_id}",args: {
                                myVar1: "{custom_arg_1}",myVar2: "{custom_arg_2}"
                            }
                        }
                        */
                    }
                }
            }
        });

    }
    
    return next(action);
}}});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)