How to use the botframework-webchat-core.createStore function in botframework-webchat-core

To help you get started, we’ve selected a few botframework-webchat-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / BotFramework-Emulator / packages / app / client / src / state / sagas / chatSagas.ts View on Github external
public static *newChat(action: ChatAction>): Iterable {
    const { documentId, resolver } = action.payload;
    // Create a new webchat store for this documentId
    yield put(webChatStoreUpdated(documentId, createWebChatStore()));
    // Each time a new chat is open, retrieve the speech token
    // if the endpoint is speech enabled and create a bound speech
    // pony fill factory. This is consumed by WebChat...
    yield put(webSpeechFactoryUpdated(documentId, undefined)); // remove the old factory
    const conversationId = yield select(getConversationIdFromDocumentId, documentId);
    // Try the bot file
    let endpoint: IEndpointService = yield select(getEndpointServiceByDocumentId, documentId);
    // Not there. Try the service
    if (!endpoint) {
      try {
        const serverUrl = yield select((state: RootState) => state.clientAwareSettings.serverUrl);
        const endpointResponse: Response = yield ConversationService.getConversationEndpoint(serverUrl, conversationId);
        if (!endpointResponse.ok) {
          const error = yield endpointResponse.json();
          throw new Error(error.error.message);
        }
github microsoft / BotFramework-WebChat / packages / component / src / Composer.js View on Github external
  const memoizedStore = useMemo(() => store || createStore(), [store]);