# creasync

> Asynchronous component and route for react

Latest version **0.1.7** (published 2017-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install creasync
pnpm add creasync
yarn add creasync
bun add creasync
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2017-06-16 |
| First published | 2017-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sheenan Tenepre |
| Maintainers | therealedsheenan |

## Links

- npm: https://www.npmjs.com/package/creasync
- Repository: https://github.com/therealedsheenan/creasync
- Homepage: https://github.com/therealedsheenan/creasync#readme
- Issues: https://github.com/therealedsheenan/creasync/issues
- npm.io page: https://npm.io/package/creasync

## Dependencies (6)

- [path](https://npm.io/package/path.md) ^0.12.7
- [react](https://npm.io/package/react.md) ^15.6.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.1
- [react-dom](https://npm.io/package/react-dom.md) ^15.6.1
- [babel-preset-react](https://npm.io/package/babel-preset-react.md) ^6.24.1
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.24.1

## Recent versions

- 0.1.7 (latest) — 2017-06-16
- 0.1.5 — 2017-06-16
- 0.1.3 — 2017-05-24
- 0.1.2 — 2017-05-24
- 0.1.1 — 2017-05-24
- 0.1.0 — 2017-05-24
- 0.0.1 — 2017-05-24

## README

# Creasync [![Build Status](https://travis-ci.org/therealedsheenan/creasync.svg?branch=master)](https://travis-ci.org/therealedsheenan/creasync) [![Dependency Status](https://dependencyci.com/github/therealedsheenan/creasync/badge)](https://dependencyci.com/github/therealedsheenan/creasync)
Asynchronous route and component for react.

Using webpack chunking, the imported component's chunk will be automatically be created.
 With this, We can also implement the lazy loading component and error component.

### Methods
The `creasync` method accepts an object.

`component` - component path.

`error` - error component to be rendered.

`loading` - loading component to be rendered.

### Sample
```
import creasync from 'creasync'

const NewComponent = creasync({
    component: System.import('url-to-component'),
    error: () => (<div>Something went wrong...</div>),
    loading: () => (<div>loading component...</div>)
})
```

### Examples
See the examples directory.

run the server
```
npm run examples:serve
```
then run webpack

```
npm run examples:webpack
```

#### Disclaimer
Work in progress

---
_Source: https://npm.io/package/creasync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
