adopted-ember-addons / adopted-ember-addons/ember-data-model-fragments
[question] Suggested method of getting actual changedAttributes()?
- Lenguaje dominante
- TypeScript
- Estrellas
- 367
- Forks
- 108
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
https://github.com/lytics/ember-data-model-fragments/blob/d86b15a4eb4b216fe20a380754bc1457f8bdc352/addon/ext.js#L148
```
// An actual diff of the fragment or fragment array is outside the scope
// of this method, so just indicate that there is a change instead
```
What would be the best way (avoiding Ember private methods) to get the actual changes, or most importantly, get the original version/values of a `Fragment` or `FragmentArray`?
Calling `fragment._internalModel.changedAttributes()` _does_ give us the old and new values/states. You would still have to do diff'ing between the two manually, but at least `changedAttributes()` returns the old an new values/state.
Any suggestions? Or, is there a good reason for this behavior?
Cheers!
Guía de contribución
Línea de trabajo
Review addon/ext.js at line 148 and the surrounding change-tracking behavior. Compare the public APIs with fragment._internalModel.changedAttributes() to determine whether original values and actual diffs can be accessed without private methods. Done means the supported approach and its limitations are clearly documented or an agreed API change is specified.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 28/100