agile-ts / agile

🌌 Global State and Logic Library for JavaScript/Typescript applications

Home Page:https://agile-ts.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ComputedTracker to each function that returns something

bennoinbeta opened this issue Β· comments

commented

πŸ› Bug report

πŸ€– Current Behavior

Currently functions like exists(), is(), .. can't get autodetected by the Computed Class since we don't track it.

🎯 Expected behavior

Track each class that doesn't return this, since it can influence the Computed Value

πŸ“„ Reproducible example

grafik

πŸ’‘ Suggested solution(s)

add ComputedTracker.tracked(this.observer);
grafik

commented

In theory, it should already track the stuff in case of exists() or is()
since the function internally calls this.value which then calls the ComputedTracker.

 return !this.isPlaceholder && this.computeExistsMethod(this.value);
//                                                                                             |  (calls this.value)
// --------------------------------------------------------------
commented

Not tracked methods:

  • getGroupCount() (not trackable)
  • getSelectorCount() (not trackable)
  • getPublicValue() (intentional because internal method)
  • getPersistableValue() (inentional because internal method)

the rest should now be trackable