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

useStateList return index and set currentIndex #634

Open
ralphchristianeclipse opened this issue Sep 28, 2019 · 0 comments
Open

useStateList return index and set currentIndex #634

ralphchristianeclipse opened this issue Sep 28, 2019 · 0 comments

Comments

@ralphchristianeclipse
Copy link

ralphchristianeclipse commented Sep 28, 2019

currently useStateList returns

{
        state: stateSet[currentIndex],
        next: next,
        prev: prev,
    };

it would be great if you also return the currentIndex which will be used as a page indicator.

{
        state: stateSet[currentIndex],
        next: next,
        prev: prev,
        index: currentIndex

    };

also if you can add a setCurrentIndex that would be awesome.

@ralphchristianeclipse ralphchristianeclipse changed the title useStateList useStateList return index and set currentIndex Sep 28, 2019
xobotyi added a commit that referenced this issue Nov 7, 2019
…At` methods as requested in #634;

Reworked a bit implementation of `next` and `prev` to make it reuse the `setStateAt` method;
streamich pushed a commit that referenced this issue Nov 8, 2019
# [13.4.0](v13.3.0...v13.4.0) (2019-11-08)

### Features

* **useStateList:** implemented `currentIndex`, `setState`, `setStateAt` methods as requested in [#634](#634); ([43cb6aa](43cb6aa))
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

1 participant