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

[Feature Request] Move refresh() from RootApi to FolderApi ? #510

Closed
Tracked by #396
scarletsky opened this issue Mar 9, 2023 · 2 comments
Closed
Tracked by #396

[Feature Request] Move refresh() from RootApi to FolderApi ? #510

scarletsky opened this issue Mar 9, 2023 · 2 comments
Milestone

Comments

@scarletsky
Copy link

Now we can only call refresh() on the RootApi, but not on FolderApi.

const pane = new Pane({ title: 'Pane' });
const folder = pane.addFolder({ title: 'folder' });

folder.refresh(); // not work, no `refresh` method on FolderApi.
pane.refresh(); // work

This will refresh all bindings.
If the pane has many fields, it would cause performance issue.

And your RootApi#refresh implementation can safely move to FolderApi.

Now I am doing the same thing on my codebase.

import('tweakpane').then(module => {
    const { Pane, FolderApi } = module;

    if (!FolderApi.prototype.refresh) {
        FolderApi.prototype.refresh = Pane.prototype.refresh;
    }
});

I think this will be useful.

@cocopon cocopon added this to the 4.0.0 milestone Mar 9, 2023
@cocopon cocopon mentioned this issue Mar 9, 2023
24 tasks
cocopon added a commit that referenced this issue Mar 9, 2023
@cocopon
Copy link
Owner

cocopon commented Mar 9, 2023

Implemented in #513 and it will be released in the next major version 4. Please wait for the next release...

@scarletsky
Copy link
Author

Great ! Wait for v4. 😄

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

No branches or pull requests

2 participants