refract-redux-xstream
Advanced tools
Comparing version
@@ -50,3 +50,4 @@ import xs from 'xstream'; | ||
var defaultOptions = { | ||
eventsPrefix: '@@event/' | ||
eventsPrefix: '@@event/', | ||
methodName: 'observe' | ||
}; | ||
@@ -82,3 +83,3 @@ function refractStoreEnhancer(options) { | ||
}; | ||
store.observe = observeFactory(store); | ||
store[opts.methodName] = observeFactory(store); | ||
return store; | ||
@@ -85,0 +86,0 @@ }; }; |
@@ -56,3 +56,4 @@ 'use strict'; | ||
var defaultOptions = { | ||
eventsPrefix: '@@event/' | ||
eventsPrefix: '@@event/', | ||
methodName: 'observe' | ||
}; | ||
@@ -88,3 +89,3 @@ function refractStoreEnhancer(options) { | ||
}; | ||
store.observe = observeFactory(store); | ||
store[opts.methodName] = observeFactory(store); | ||
return store; | ||
@@ -91,0 +92,0 @@ }; }; |
{ | ||
"name": "refract-redux-xstream", | ||
"description": "Refract bindings for Redux with xstream: harness the power of reactive programming to supercharge your components!", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "jsnext:main": "index.es.js", |
export interface EnhancerOptions { | ||
eventsPrefix: string | ||
methodName: string | ||
} | ||
@@ -4,0 +5,0 @@ export declare type ActionListener = (action: object) => void |
import refractEnhancer from './refractEnhancer' | ||
import { EnhancerOptions } from './baseTypes' | ||
export { refractEnhancer, EnhancerOptions } | ||
import { StoreObserveFunction } from './observable' | ||
export { refractEnhancer, EnhancerOptions, StoreObserveFunction } |
import { Stream } from 'xstream' | ||
import { Selector } from './baseTypes' | ||
export interface ObserveFn { | ||
export interface StoreObserveFunction { | ||
<Type>(actionTypeOrListener: string | Selector<Type>): Stream<Type> | ||
} | ||
export declare const observeFactory: (store: any) => ObserveFn | ||
export declare const observeFactory: (store: any) => StoreObserveFunction |
import { StoreEnhancer, AnyAction, Action as ReduxAction } from 'redux' | ||
import { ObserveFn } from './observable' | ||
import { StoreObserveFunction } from './observable' | ||
import { AddActionListener, EnhancerOptions } from './baseTypes' | ||
@@ -7,3 +7,3 @@ declare module 'redux' { | ||
addActionListener: AddActionListener | ||
observe: ObserveFn | ||
observe: StoreObserveFunction | ||
} | ||
@@ -10,0 +10,0 @@ } |
15917
1.38%197
2.07%