Skip to content

feat: Добавлено событие everything, срабатывающее при любом событии #217

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

evgeniysemin
Copy link
Contributor

@evgeniysemin evgeniysemin commented Oct 20, 2021

📦 Published PR as canary version: 4.10.0--canary.217.61c59d5c905a6880310bdb4dc3ea35f85766a342.0

✨ Test out this PR locally via:

npm install @sberdevices/assistant-client@4.10.0--canary.217.61c59d5c905a6880310bdb4dc3ea35f85766a342.0
# or 
yarn add @sberdevices/assistant-client@4.10.0--canary.217.61c59d5c905a6880310bdb4dc3ea35f85766a342.0

@sasha-tlt
Copy link
Contributor

sasha-tlt commented Oct 22, 2021

@evgeniysemin, в задаче имелось ввиду, подписаться на сообщения для канваса (createAssistant, https://github.com/sberdevices/assistant-client/blob/main/src/createAssistant.ts#L282)

const observables = new Map<string, { next: ObserverFunc<A | AssistantSmartAppError>; requestId?: string }>();
const { on, emit } = createNanoEvents<AssistantEvents<A> & EverythingEvent<A>>();
const emitCommand = (command: AssistantClientCustomizedCommand<A>) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emitCommand не случится, если есть подписка на ответ - эмитить everything нужно в любом случае
https://github.com/sberdevices/assistant-client/pull/217/files#diff-4a8e2af747f7708c3f686add51592371c9d7ffd3a905ff4b25fcfa1859e31e10L209

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants