#include <range/v3/all.hpp>
#include <AUI/Platform/Entry.h>
#include "AUI/Platform/AWindow.h"
#include "AUI/Util/UIBuildingHelpers.h"
#include "AUI/View/AScrollArea.h"
#include "AUI/View/ASpinnerV2.h"
#include "AUI/View/AForEachUI.h"
#include "AUI/Model/AListModel.h"
#include "AUI/Thread/AAsyncHolder.h"
using namespace declarative;
using namespace ass;
using namespace std::chrono_literals;
struct Item {
};
struct State {
};
if (!newState) {
return;
}
auto loadFrom = state->items->size();
state->asyncTasks <<
async {
AThread::sleep(500ms);
auto loadedItems = AVector<_<Item>>::generate(20, [&](size_t i) {
return aui::ptr::manage(new Item { .value = "Item {}"_format(loadFrom + i) });
});
state->items.writeScope()->insertAll(loadedItems);
state->needMore = false;
};
};
});
return Vertical {
Centered {
state->needMore = true;
});
},
},
};
}
auto window = _new<AWindow>("Infinite Lazy List", 200_dp, 300_dp);
window->show();
return 0;
}
Holds a set of futures keeping them valid.
Definition AAsyncHolder.h:31
static constexpr AObjectBase * GENERIC_OBSERVER
Indicates that a connection should not be explicitly linked to receiver's lifetime.
Definition AObject.h:61
Places views in a column.
Definition AVerticalLayout.h:41
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:179
static decltype(auto) connect(const Signal &signal, Object *object, Function &&function)
Connects signal to the slot of the specified object.
Definition AObject.h:86
#define let
Performs multiple operations on a single object without repeating its name (in place) This function c...
Definition kAUI.h:262
#define AUI_DECLARATIVE_FOR(value, model, layout)
ranged-for-loop style wrapped for AForEachUI.
Definition AForEachUI.h:402
#define AUI_ENTRY
Application entry point.
Definition Entry.h:90
#define ui_thread
Executes lambda on main thread.
Definition kAUI.h:397
#define async
Executes following {} block asynchronously in the global thread pool. Unlike asyncX,...
Definition kAUI.h:329
Basic easy-to-use property implementation containing T.
Definition AProperty.h:30