open-index/open-npm huggingface dataset:
npm package: @mizchi/ssr-helpers
Description: Implement `react-cache` SSR helpers.
Latest version: 0.0.1

# @mizchi/ssr-helpers

Implement `react-cache` SSR helpers.

## Requirements

- react: ^16.7
- react-dom: ^16.7
- regenerator-runtime(included babel-polyfill)

## Data fetcher

```tsx
import { renderAsync, createResource } from "@mizchi/ssr-helpers";

// data fetcher
const resource = createResource(async () => {
  await new Promise(r => setTimeout(r, 1000));
  return { message: "hello" };
});

function App() {
  const data = resource.read();
  return <div>{data.message}</div>;
}

const html = await renderAsync({
  tree: <App />
});
```

Client rendering

```tsx
import React from "react";
import ReactDOM from "react-dom";

const root = document.querySelector(".root") as HTMLDivElement;
ReactDOM.hydrate(
  <Suspense fallback="loading">
    <App />
  </Suspense>,
  root
);
```

## How to dev

- `yarn dev`: Start application server on `http://localhost:1234`
- `yarn build`: Generate `dist`
- `yarn test`: Run jest
- `yarn deploy`: Deploy to netlify (need netlify account)

## LICENSE

MIT
npm package: @mizchi/storage
Description: Storage(localStorage, sessionStorage) helper for KVS.
Author: azu
Latest version: 1.1.0

# @kvs/storage

Storage-like for KVS.

You can inject Storage object like localStorage, sessionStorage to this storage.

## Install

Install with [npm](https://www.npmjs.com/):

    npm install @kvs/storage

## Usage

```ts
import assert from "assert";
import { kvsStorage } from "@kvs/storage";
(async () => {
    type StorageSchema = {
        a1: string;
        b2: number;
        c3: boolean;
    };
    const storage = await kvsStorage<StorageSchema>({
        name: "test",
        version: 1,
        storage: localStorage
    });
    await storage.set("a1", "string");
    await storage.set("b2", 42);
    await storage.set("c3", false);
    const a1 = await storage.get("a1");
    const b2 = await storage.get("b2");
    const c3 = await storage.get("c3");
    assert.strictEqual(a1, "string");
    assert.strictEqual(b2, 42);
    assert.strictEqual(c3, false);
})();
```

## Changelog

See [Releases page](https://github.com/azu/kvs/releases).

## Running tests

Install devDependencies and Run `npm test`:

    npm test

## Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, [please create an issue](https://github.com/azu/kvs/issues).

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## Author

- [github/azu](https://github.com/azu)
- [twitter/azu_re](https://twitter.com/azu_re)

## License

MIT © azu
npm package: @mizchi/storage-sync
Description: Storage(localStorage, sessionStorage) helper for KVS.
Author: azu
Latest version: 1.1.0

# @kvs/storage-sync

Storage-like for KVS.

You can inject Storage object like localStorage, sessionStorage to this storage.

[@kvs/storage](https://github.com/azu/kvs/tree/master/packages/storage) is async version, but `@kvs/storage-sync` is sync version.

## Feature

- Synchronize version [@kvs/storage]
- Support `[Symbol.iterator]` instead of `[Symbol.asyncIterator]`
- Injectable `localStorage` or `sessionStorage`

## Install

Install with [npm](https://www.npmjs.com/):

    npm install @kvs/storage-sync

## Usage

```ts
import assert from "assert";
import { kvsStorageSync } from "@kvs/storage";
(() => {
    type StorageSchema = {
        a1: string;
        b2: number;
        c3: boolean;
    };
    const storage = kvsStorageSync<StorageSchema>({
        name: "test",
        version: 1,
        storage: localStorage
    });
    storage.set("a1", "string");
    storage.set("b2", 42);
    storage.set("c3", false);
    const a1 = storage.get("a1");
    const b2 = storage.get("b2");
    const c3 = storage.get("c3");
    assert.strictEqual(a1, "string");
    assert.strictEqual(b2, 42);
    assert.strictEqual(c3, false);
})();
```

## Changelog

See [Releases page](https://github.com/azu/kvs/releases).

## Running tests

Install devDependencies and Run `npm test`:

    npm test

## Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, [please create an issue](https://github.com/azu/kvs/issues).

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## Author

- [github/azu](https://github.com/azu)
- [twitter/azu_re](https://twitter.com/azu_re)

## License

MIT © azu