ngxtension / ngxtension-platform

Utilities for Angular

Home Page:https://ngxtension.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

computedAsync + computedFrom RFC

eneajaho opened this issue · comments

  • Rename computedAsync to derivedAsync && computedFrom to derivedFrom because:

    • we don't want to give developers the wrong idea regarding a computed which is a lazily evaluated pure function of its inputs
      • computedAsync is not lazily evaluated
      • the computation functions does async work and it's not pure because it depends on timing
    • By renaming it to something else -> we can set specific rules that don't depend on the meaning of a computed signal
    • IMPORTANT: All the code usages will be migrated automatically to the new function name using ng update schematics.
  • Deprecate previousValue in computedAsync as it's buggy and most of the time it's hard to reason about in a async + previousValue way.

    • If you're using it, please provide the usecase and how you're using it, in order to see how we can support you on that.

PR: #303