Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Outdated documentation for load() #2966

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

Closed
E4RIJMP opened this issue Feb 27, 2025 · 1 comment
Closed

Outdated documentation for load() #2966

E4RIJMP opened this issue Feb 27, 2025 · 1 comment

Comments

@E4RIJMP
Copy link

E4RIJMP commented Feb 27, 2025

Hello the JSDoc (and README.md) for load does not match the actual implementation:

    /**
     * load the widgets from a list. This will call update() on each (matching by id) or add/remove widgets that are not there.
     *
     * @param layout list of widgets definition to update/create
     * @param addAndRemove boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving
     * the user control of insertion.
     *
     * @example
     * see http://gridstackjs.com/demo/serialization.html
     */
    load(items: GridStackWidget[], addRemove?: boolean | AddRemoveFcn): GridStack;

The params are items (not layout) and addRemove (not addAndRemove).

See:

public load(items: GridStackWidget[], addRemove: boolean | AddRemoveFcn = GridStack.addRemoveCB || true): GridStack {

### `load(layout: GridStackWidget[], boolean | ((w: GridStackWidget, add: boolean) => void) = true)`

@adumesny
Copy link
Member

adumesny commented Feb 27, 2025

that's the problem with static doc... I need to switch over to generate from the .ts files - or just rely on API and comments for documentation...

BUT those are just var names and doesn't matter. it's the type that does,

adumesny added a commit that referenced this issue Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants