Skip to content

allow easy data editing via callback #133

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

Open
mknj opened this issue Sep 3, 2020 · 1 comment
Open

allow easy data editing via callback #133

mknj opened this issue Sep 3, 2020 · 1 comment
Labels

Comments

@mknj
Copy link

mknj commented Sep 3, 2020

Motivation

I want to change all found elements via a callback. (i.e. rewrite $ref: )
other libraries have an apply(...,callback) method, that allows to change values easily by updating the value with the callback return value.

Current behavior

In this example I want to double all found values.

{ callback: (v,_dummy,p)=>p.parent[p.parentProperty]=v*2 }

This syntax is especially bad if you work with typescript and eslint no_unused_var

Desired behavior

{ applycb: (v)=>v*2 }
@mknj mknj added the Feature label Sep 3, 2020
@rattrayalex
Copy link

An example of how to do this yourself is here: #163 (comment)

Let me know if you have any issues with it…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants