Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Last active October 14, 2020 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmotta/c998d3104a1c6ca3c93f7373820c5e8f to your computer and use it in GitHub Desktop.
Save ljmotta/c998d3104a1c6ca3c93f7373820c5e8f to your computer and use it in GitHub Desktop.
EmbeddedTodoList Poll Init
import { EnvelopeServer } from "@kogito-tooling/envelope-bus/dist/channel";
import { TodoListChannelApi, TodoListEnvelopeApi } from "../api";
export const EmbeddedTodoList = React.forwardRef<TodoListApi, Props>((props, forwardedRef) => {
const pollInit = useCallback((envelopeServer: EnvelopeServer<TodoListChannelApi, TodoListEnvelopeApi>) => {
return envelopeServer.envelopeApi.requests.todoList__init(
{
origin: envelopeServer.origin,
envelopeServerId: envelopeServer.id,
},
{ user: "Tiago" }
);
}, []);
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment