Git Product home page Git Product logo

aurelia-collection's People

Contributors

chabou-san avatar dependabot[bot] avatar jule- avatar typedef42 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jule-

aurelia-collection's Issues

Update() is not merging attributes

Update() method should merge attributes from newly fetch json, instead of replacing it.
In some case it causes problems when partial json is received, it then erase the model previously received data

Wrong merge when syncing model

sync and then _syncFrom are not syncing correctly. It only update previously undefined fields. I new data is available it is ignored due to _.defaults()

Sub-model references are not instantiated on first `get`.

I'm submitting a bug report

  • Framework Version:
    v0.4.9

  • Language:
    ESNext

Current behavior:
When first get request is processed, models are not well processed and then referenced sub-models are not created.

Expected/desired behavior:
When requiring model for the first time we want sub-models to be well instantiated.


In fact issue seems to be somewhere related to the backendKey to frontendKey conversion.

let itemData = model[item.backendKey];

Indeed here we are trying to get in model the backendKey while inside it is already converted to frontendKey. As a result itemData is undefined and sub-models will not be instantiated.

refKeys definition through arrays

I'm submitting a feature request

  • Framework Version:
    0.5.0

  • Current behavior:
    When declaring refKey like this: some._ref_key, actually we cannot address the use case where some is an array and we want to rewrite refKeys inside each element of this array.

  • What is the motivation / use case for changing the behavior?
    The need of handling association patterns in models. For example we want to associate BehaviorModel to an ActorModel in a specific PlayModel.
    The easiest way to do it is to create an array in the PlayModel which possesses associations of ActorModel and BehaviorModels. Indeed the association of BehaviorModel and ActorModel is contextual to the PlayModel and I dont want to create another collection to handle this as an 1<=>1 association (1 PlayModel <=> 1 hypothetical PlayActorBehaviorAssociationModel).

aurelia-collection should iterate over model arrays in order to rewrite refKeys.

Investigate the Date attribute problem in Update()

When a newly model is created with an date attribute, the constructor transforms it in a Date() object. If update is called on this model, the date attribute is reset to string date, and the Date() object is destroyed.

Renaming in the src/config.js file?

I wonder if we shouldn't rename the collection naming within that specific file to use a more explicit service, such as registerService or getService. This is rather confusing with the Collection class (and file) we provide for aurelia resolving mechanic.
Or did I miss something ?

set up unit tests

Finish to set up Karma unit tests, and start a travis CI build setup.

Find method that allow to fetch upon custom fields

We should implement a find method that allow to fetch upon custom field, that first check upon local models. It represent 80% of or custom methods in collections, and will avoid direct fetch in thoses.

Multiple Collection instance of the same class

We cannot use the same collection class multiple times. It's ok when we re-implement a specific collection class, but start to be anoying when using the generic one.
-> we should find a way to make it painless at configuration time for the devs

Service.update updating strategy

For now the update() method wait for backend response, and set the responded json to the model attributes.

It causes problem when backend response is not what the model expects.
For example Dates :
On the get from service the constructor method of a model can transform a date sent as string by the backend response.
But on the service update case, the model has no chance to transform the response from the backend and then have its date attributes overwriten by strings.

Maybe we should merge the local json (body argument of the update) instead of the response of the backend.

Update the README.md

Update the readme.md with quick start usage, and examples.
also add badges (contributors, build success, npm etc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.