Knockout-Contrib / Knockout-Contrib/Knockout-Validation

`validatable` extender forces pureComputed evaluation

Open
#622 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1k
Forks
366
PR merge metrics
No merged PRs in 30d

Description

I think most library users would expect that pureComputed is computed lazily, that is only when it's value is accessed, since validity is a pure function of an observable's value, the value is only needed when isValid or error or something like that is called, adding or removing validation from an observable does not require it's value to be accessed.

Demo: https://jsfiddle.net/vjdm45g5/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked jsfiddle to reproduce the eager evaluation, then locate the validatable extender and trace why adding or removing validation reads a pureComputed value. Done means validation setup no longer forces evaluation, while isValid and error still evaluate correctly when accessed; add or update coverage if the repository has tests for this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.