Replies: 2 comments 2 replies
-
See flowResult api
…On Mon, 15 Feb 2021, 00:44 Andrey Osiyuk, ***@***.***> wrote:
Can mobx include toGenerator type from mobx-state-tree?
export function* toGenerator<R>(p: Promise<R>): Generator<Promise<R>, R, R> {
return (yield p) as R}
It helps to keep type after yield
const result = yield* toGenerator(api.getResult())// result will be return type of api.getResult() instead of type `any`
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2804>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBEASXYDJ6TNCGWZ37TS7BU55ANCNFSM4XTY3MWA>
.
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can
mobx
includetoGenerator
type frommobx-state-tree
?It helps to keep type after yield
Beta Was this translation helpful? Give feedback.
All reactions