Skip to content

v2.5.0

Compare
Choose a tag to compare
@akuzko akuzko released this 12 Oct 08:12
· 61 commits to master since this release

Release Description

  • Added validation dependencies by declaring validation as an object with rules and deps properties, where rules specify any acceptable validation rules, and deps is an array of dependency input names. For example:

    function ItemForm() {
      const {$} = useForm({}, {
        min: ["presence", "numericality"],
        max: {
          rules: [
            "presence",
            "numericality",
            function(value, {attrs}) {
              if (value <= attrs.min) {
                return "Should be greated than 'min'";
              }
            }
          ],
          deps: ["min"]
        }
      })
    }

    Wildcards are also supported as dependencies (more details in README)

  • Initial config resolution is now memoized to get rid of redundant resolutions on each render.