Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types: Add types for ReadonlyObservable, ReaonlyObservableArray, ReadonlyComputed #2476

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Apr 12, 2019

  1. Add ReadonlyObservable type

    Observables can be cast to readonly observable to indicate that they shouldn't be mutated, or functions can accept readonly observables to indicate that they won't mutate them
    Retsam committed Apr 12, 2019
    Configuration menu
    Copy the full SHA
    9f91f37 View commit details
    Browse the repository at this point in the history
  2. Add ReadonlyObservableArray type

    ObservableArrays can be cast to this type to prevent mutation, or taken as function arguments to indicate that the function will not mutate the observable
    Retsam committed Apr 12, 2019
    Configuration menu
    Copy the full SHA
    ad87269 View commit details
    Browse the repository at this point in the history
  3. Add ReadonlyComputed type

    Computeds can be cast to this type to prevent mutation, or taken as function arguments to indicate that the function will not write to this computed
    
    In theory certain ko.computed overrides should return this, but this is not currently the case
    Retsam committed Apr 12, 2019
    Configuration menu
    Copy the full SHA
    aa66af6 View commit details
    Browse the repository at this point in the history