I know of 2 ways that are not very convenient and look inelegant:
-
Via then:
(new TestClass).syncMethod().asyncMethod().then(self => self.anotherSyncMethod())
-
Via await:
(await (new TestClass).syncMethod().asyncMethod()).anotherSyncMethod()
I expect it to be something like this (pseudocode):
(new TestClass).syncMethod().asyncMethod()->anotherSyncMethod()
where ->
is the transition from an async method to a synchronous one.
Is there something like this in JS, and if not, is there any plans for it in the future?