Giter Site home page Giter Site logo

Comments (7)

zombieJ avatar zombieJ commented on August 30, 2024

Hmmm. Not sure if we could provides getFields function out for user to filter themself since there are lots of getXXXFieldsValue if we provide this api.

from field-form.

mgcrea avatar mgcrea commented on August 30, 2024

Maybe with a more generic filterFieldsValue that would take a callback?

filterFieldsValue([], meta => meta.touched)

We could also drop the first arg (nameList) and have (name, meta) as the callback signature to let the user eventually filter by name. That would probably be even more elegant:

filterFieldsValue((name, meta) => optionalNameList.includes(name) && meta.touched)

Or another naming you would find more suitable, some ideas:

  • getFieldsValueByMeta
  • filterFieldsValueByMeta
  • filterFieldsValue (cleaner, would be my pick)

If you are good with such changes, I'll happily rework the PR.

from field-form.

zombieJ avatar zombieJ commented on August 30, 2024

How about getFieldsValue([nameList?: NamePath[],] filterFunc?: (meta: Meta) => boolean)?

cc @afc163 @yesmeck @chenshuai2144

from field-form.

mgcrea avatar mgcrea commented on August 30, 2024

Looks clean with minimal API surface change 👍

from field-form.

mgcrea avatar mgcrea commented on August 30, 2024

@zombieJ any update regarding this? Could work on a PR with your latest API.

from field-form.

zombieJ avatar zombieJ commented on August 30, 2024

Yes, please.

from field-form.

mgcrea avatar mgcrea commented on August 30, 2024

@zombieJ I've updated the PR #44 with the new API, looking forward to hear your feedback.

from field-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.