0.6.5 • Published 5 years ago

redux-loadings v0.6.5

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

redux-loadings renamed to region-shortcut!!!

version npm downloads codecov MIT License

A replacement tool of redux to handle sync & async action flow. Extremely simple API!

English | 中文

PackageVersionDocsDescription
region-coreversionnpm.ioThe core of Region: set, load & connect
region-shortcutversionnpm.ioWrapped core with global Provider, set, load & connect
region-formversionnpm.ioRegionForm extends Region: bindWith any ant-design form item

Get Started

npm i region-shortcut
// or
npm i region-core

Then create your Component

import { connectWith } from 'region-shortcut';
import { fetchUser } from './fetch'; // somewhere with axios

load('user', fetchUser);

const Display = ({ user }) => <div>{user}</div>

export default connectWith('user', Display);

or

import { connectWith } from 'region-shortcut';
import { fetchUser, fetchFollower } from './fetch'; // somewhere with axios

load('user', fetchUser);
const handleClick = () => load('follower', fetchFollower);

const Display = ({ loading, error, user, follower }) => (
  <div>
    {user}
    {follower}
    <Button loading={loading} onClick={handleClick} />
  </div>
);

export default connectWith(['user', 'follower'], Display);

Docs

Document And Best Practices

Migrate Guide

ChangeLog

Example

Online Example

git clone https://github.com/regionjs/region-core.git
cd example
npm i
npm start

Contribute

Region is Extremely easy to extend, fire a issue if you have some great idea.

import { Region } from 'region-core';

class MyRegion extends Region {
  constructor(...args) {
    super(...args);
    this.someFunc = this.someFunc.bind(this); // in case you are not using class field
  }

  someFunc() {}
}

As for pull request, make sure to add test for your code.

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.6.0-alpha.2

5 years ago

0.6.0-alpha.1

5 years ago

0.6.0-alpha

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.2.0-alpha

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago