Skip to content

Instantly share code, notes, and snippets.

@cheton
Created November 21, 2018 13:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheton/c872b5b8c8109dbe663f9ccf54b0d480 to your computer and use it in GitHub Desktop.
Save cheton/c872b5b8c8109dbe663f9ccf54b0d480 to your computer and use it in GitHub Desktop.
Carousel
@cheton
Copy link
Author

cheton commented Nov 21, 2018

<Carousel limit={10} total={100} data={data}>
    {({ offset, limit, total, data, next }) => {
        if (!data) {
            return null;
        }

        setTimeout(() => next(), 2000);

        const start = offset;
        const end = offset + limit;
        const slicedData = data.slice(start, end);

        return (
            <div>{/* TODO */}</div>
        );
    }}
</Carousel>

@xJkit
Copy link

xJkit commented Nov 22, 2018

awesome

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