Code Monkey home page Code Monkey logo

Comments (7)

yz1311 avatar yz1311 commented on May 16, 2024 16

集成过程:

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.

luckyadam avatar luckyadam commented on May 16, 2024

0.0.42 修复了 redux-saga 包抽离文件的问题,但是发现运行还是有问题,因为 redux-saga 里存在循环依赖,导致小程序解析错误,目前解决方案是 redux-saga 编译好的文件下载到本地进行使用 这样来使用 import createSagaMiddleware from 'redux-saga/dist/redux-saga'

from taro.

wkh2 avatar wkh2 commented on May 16, 2024

您好 ,我启动服务的时候出现了这个错误,
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.

luckyadam avatar luckyadam commented on May 16, 2024

@wkh2 你好,因为 �H5 的 TS 支持还没完全好,所以建议先使用 js 来开发

from taro.

Rychou avatar Rychou commented on May 16, 2024

@luckyadam 你好,我在集成redux-saga时发现没有这个文件,redux-saga/dist/redux-saga.
版本:redux-saga:^1.0.1

from taro.

luowenming avatar luowenming commented on May 16, 2024

-webkit-box-orient: vertical;
这个样式编译成h5就没了?微信小程序是可以的。

from taro.

lilywang711 avatar lilywang711 commented on May 16, 2024

@luckyadam 你好,我在集成redux-saga时发现没有这个文件,redux-saga/dist/redux-saga.
版本:redux-saga:^1.0.1

@Rychou 需要降级下 redux-saga 的版本到^0.16.2

from taro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.