acdlite / acdlite/redux-rx

Any plans for creating typescript definitions? Also, is rxjs5 on the roadmap?

Đang mở
#23 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
1k
Fork
34
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Are there any types available for redux-rx? I tried `npm install @types/redux-rx` and looks like there are none. Eventually I tried the following:

**tsconfig.json**

"typeRoots": [
"./node_modules/@types",
"./public/shared/types"
]

**index.d.ts**

declare module 'redux-rx';

Eventually i got this error. After some digging on the web I understand that rx is v4 and rxjs is v5

ERROR in ./node_modules/redux-rx/lib/observableFromStore.js
Module not found: Error: Can't resolve 'rx' in '....\node_modules\redux-rx\lib'
@ ./node_modules/redux-rx/lib/observableFromStore.js 6:10-23
@ ./node_modules/redux-rx/lib/index.js
@ ./public/main.ts
@ multi (webpack)-dev-server/client?http://localhost:8081 ./public/main.ts

Considering that all I need is the following, I'll just write it myself in a service.

function observableFromStore(store) {
return _rx.Observable.create(function (observer) {
return store.subscribe(function () {
return observer.onNext(store.getState());
});
});
}

**Updated**

function observableFromStore(store: Store) {
return Observable.create((observer: any) => {
return store.subscribe(() => {
return observer.next(store.getState());
});
});
}

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.