Introduction
What is aurelia-collection ?
This library is a plugin for the Aurelia platform and provide a simple way to store multiple set of models that can be retrieved (or pushed) to a backend collections and its REST api.
Have you ever felt that you were writting the exact same code in your view-models to fetch objects from your backend ?
aurelia-collection aims to avoid this, by providing both a REST service-like functionnality that can wrap your backend API, and a repository collection functionnality that will store and sync the objects (or model instances) you fetch from your backend.
Some advantages are :
- Reduce the number of HTTP requests your application use when changing route and activating new view-models.
- Objects fetched are stored outside of your model-views scopes.
- Handle populated sub-models.
- Provide a standard service behavior that can be used for most of the classic use-cases, and can simply be enriched with custom behavior through inheritance.
- Can handle multiple collections at the same time, that themselves handle object literals or custom Model classes instances.
- Provide a Collection resolver to simply inject your different collections instances where you need them.
Overview of CRUD requests with aurelia-collection :
Updated less than a minute ago