valotas / mustache4dart

mustache implementation for Dart
Other
87 stars 15 forks source link

partial function not designed to handle async partial resolution #52

Open sethladd opened 9 years ago

sethladd commented 9 years ago

We have a need to dynamically load partials from async sources (sources that return Future). The partial function assumes getting a partial's content is synchronous.

It would be really nice if the partial function could handle cases where it returns a Future.

Thanks!

sethladd commented 9 years ago

In the meantime, we might want to add a typdef for the partial resolver. Right now, it's just marked as Function.

valotas commented 9 years ago

In such a case the whole rendering will pause until the future is resolved. Is that ok? If so, I'll try to fix it the coming days.

sethladd commented 9 years ago

I think that is OK. On Tue, Apr 14, 2015 at 13:37 Georgios Valotasios notifications@github.com wrote:

In such a case the whole rendering will pause until the future is resolved. Is that ok? If so, I'll try to fix it the coming days.

— Reply to this email directly or view it on GitHub https://github.com/valotas/mustache4dart/issues/52#issuecomment-93051963 .

valotas commented 9 years ago

I was wrong here. Given the fact that there is not strait forward way of getting a result of a Future synchronously, I have to change the whole api so that it will be async. This is in my todo list, but for sure not something that can be done without a major factoring.

sethladd commented 9 years ago

Future is infectious, for sure.

On Thu, Apr 30, 2015 at 1:05 PM Georgios Valotasios < notifications@github.com> wrote:

I was wrong here. Given the fact that there is not strait forward way of getting a result of a Future synchronously, I have to change the whole api so that it will be async. This is in my todo list, but for sure not something that can be done without a major factoring.

— Reply to this email directly or view it on GitHub https://github.com/valotas/mustache4dart/issues/52#issuecomment-97951887 .