open-index/open-npm huggingface dataset:
npm package: @nickbottomley/react-paginate
Description: A ReactJS component for static rendering that creates a pagination.
Author: Adèle Delamarche
Latest version: 1.1.1

# react-paginate-functional

**A ReactJS component to render a pagination.**

## About this fork
This package is a fork of [react-paginate](https://github.com/AdeleD/react-paginate), however instead of using internal state and `React.Component` subclasses, it uses [stateless functional components](https://medium.com/@joshblack/stateless-components-in-react-0-14-f9798f8b992d). As such, there are no event handlers either. When using this package, you should treat the pagination links as just that – links. Let your router do the heavy lifting. This also makes it a good fit for other uses – specifically, server-rendered applications using React as a "templating" layer.

For details about the package, please see the [source repo](https://github.com/AdeleD/react-paginate). Might add details specific to this fork in the future.

## Installing
`npm install react-paginate-functional`
npm package: @nickbottomley/responses
Description: Value objects representing HTTP responses
Author: Nick Bottomley
Latest version: 0.2.0

# responses

Value objects representing HTTP responses

```
npm i -S @nickbottomley/responses
```

Requires Node.js 4+

This package is general-purpose, but is particularly useful with [koa-detour](http://github.com/nickb1080/koa-detour). Put simply, the idea is to raise the level of abstraction by having routes or resources return objects or throw errors that represent HTTP responses, rather than imperatively doing things like `res.write()` (or in Koa `ctx.body = ...`)

```js
// this isn't a complete working example, it just shows the concepts
const Koa = require("koa");
const Router = require("koa-detour");
const R = require("@nickbottomley/responses");

const app = new Koa()
const router = new Router();
router.route("/user", {
  GET (ctx) {
    if (!areUsersConnected(ctx.userId, ctx.params.id)) {
      // router handles sending this as a 403
      throw R.Forbidden("You are not connected to that user")
    }

    return getUser().then(user => {
      // router handles sending this as a 200
      return R.OK(user)
    });
  },
  POST (ctx) {
    if (ctx.body.username == null) {
      // router handles sending this as 400
      throw R.BadRequest("Username is required");
    }

    return createUser(ctx.body).then(user => {
      // router handles sending this as a 201
      return R.Created(user);
    });
  }
})

app.use(router);
```