npm.io
1.10.9 • Published 7 years ago

ola-ui-jd

Licence
MIT
Version
1.10.9
Deps
6
Size
258 kB
Vulns
1
Weekly
0

ola-ui-jd

ola-ui 的 jd 业务组件层。

Install

yarn add ola-ui-jd

DEV

yarn build  ## 打包

yarn dev  ## 打包 (watch 模式)

Quick Start

添加 reducer

import {combineReducers} from 'redux-immutable';
import {reducers as olaReducers} from 'ola-ui-jd';

export default combineReducers({
  
  // ...,

  olaReducers,

  // ...,
});

添加 saga

import {all, fork} from 'redux-saga/effects';
import {sagas as olaSagas} from 'ola-ui-jd';
import createSagaMiddleware from 'redux-saga';

export function* initSagas() {
  yield all([
    // ...,
    fork(olaSagas),
    // ...,
  ]);
}

// run saga middleware with sagas
const sagaMiddleware = createSagaMiddleware();
sagaMiddleware.run(initSagas);

调用组件

import React, {Component} from 'react';
import {SomeComponent} from 'ola-ui-jd';

export default class MyComponent extends Component {

  render() {
    return <SomeComponent />;
  }

}

Keywords