Comments (7)
集成过程:
1.app.js
//注意,该库的引用必须早于config-store的引用
import '@tarojs/async-await';
import {Provider,connect} from '@tarojs/redux';
import configStore from './store/config-store';
2./store/config-store.js
import { createStore, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga/dist/redux-saga';
import rootReducer from '../reducers';
import rootSaga from '../sagas';
const sagaMiddleware = createSagaMiddleware();
let middlewares = [sagaMiddleware];
export default function configStore () {
const store = createStore(rootReducer, applyMiddleware(...middlewares));
// then run the saga
sagaMiddleware.run(rootSaga);
return store
}
3.需要引用effects的地方
import {effects} from 'redux-saga/dist/redux-saga';
const {all,fork} = effects;
from taro.
0.0.42
修复了 redux-saga
包抽离文件的问题,但是发现运行还是有问题,因为 redux-saga
里存在循环依赖,导致小程序解析错误,目前解决方案是 把 这样来使用 redux-saga
编译好的文件下载到本地进行使用import createSagaMiddleware from 'redux-saga/dist/redux-saga'
。
from taro.
您好 ,我启动服务的时候出现了这个错误,
ERROR
TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["tests","node_modules","dist","tests","jest","lib","/*.test.ts","/*.spec.ts"]'.
from taro.
@wkh2 你好,因为 �H5 的 TS 支持还没完全好,所以建议先使用 js 来开发
from taro.
@luckyadam 你好,我在集成redux-saga
时发现没有这个文件,redux-saga/dist/redux-saga
.
版本:redux-saga:^1.0.1
from taro.
-webkit-box-orient: vertical;
这个样式编译成h5就没了?微信小程序是可以的。
from taro.
@luckyadam 你好,我在集成
redux-saga
时发现没有这个文件,redux-saga/dist/redux-saga
.
版本:redux-saga:^1.0.1
@Rychou 需要降级下 redux-saga 的版本到^0.16.2
from taro.
Related Issues (20)
- 在开发模式中启动预构建未更新路由表导致页面加载失败
- 如何实现分包间的状态管理
- WXMLRT_$gwx:./base.wxml:template:27:20: Template `tmpl_0_23` not found. HOT 1
- input type='nickname' 昵称无法填入到input
- 在canvas上进行双指缩放操作e.touches返回的数组有时候不准确
- H5端 @tarojs/components 包 treeshaking 失效 HOT 1
- taro 3.6.10 版本 打包H5在 android 9手机报错白屏:"Uncaught SyntaxError: 'super' keyword unexpected here", source: https://***/js/9.01ab024a.js (2) HOT 4
- 在config dev.js文件中devServer的historyApiFallback进行配置不生效
- 开启半编译模式 —— CompileMode报错 HOT 1
- 【虚拟瀑布流组件】能否添加gap相关字段? HOT 4
- skyline渲染模式下,自定义tabbar真机不会显示
- text,label组件上的onLongPress不生效
- 微信小程序channel-live HOT 1
- 京东小程序无法处理http status code 20x?
- Taro 打包 支付宝小程序插件,找不到插件路径
- 希望增加react-native-windwos的支持
- v4 版本有什么功能 HOT 1
- 集成模式 如何支持 react native原生的app.json中的配置项 HOT 4
- 引用 weui-miniprogram 会报错
- 怎么使用 antd-mini
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taro.