Skip to content

Instantly share code, notes, and snippets.

@njlr
Created August 21, 2017 14:30
Show Gist options
  • Save njlr/9942c1517ce7f723d0bbaa9cc4cd8f84 to your computer and use it in GitHub Desktop.
Save njlr/9942c1517ce7f723d0bbaa9cc4cd8f84 to your computer and use it in GitHub Desktop.
auto progressbar = rx::observable<>::from(
rxcpp::interval(std::chrono::milliseconds(250))
.take_until([](auto x) { return x > 100; })
.map([](auto x) { return x / 100.0;})
.map(Progressbar);
auto app = rx::observable<>::zipWith(
rx::observable<>::just<Text>("progressbar example"),
progressbar,
stackLayout);
app.scan(
VirtualTerminal(),
[](auto const& vt, Component const& c) {
return vt.flip(renderToTerm(vt, TerminalWidth, c)));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment