Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

refract-redux-rxjs

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

refract-redux-rxjs - npm Package Compare versions

Comparing version 1.0.0-3 to 1.0.0-4

README.md

11

index.es.js

@@ -29,4 +29,3 @@ import { from, Observable } from 'rxjs';

var storeObservable = from(store);
return function (actionOrSelector, opts) {
var options = __assign({ initialValue: true }, opts);
return function (actionOrSelector) {
if (typeof actionOrSelector === 'string') {

@@ -39,9 +38,3 @@ return Observable.create(function (listener) {

if (typeof actionOrSelector === 'function') {
var operators = [
map(actionOrSelector),
options.initialValue &&
startWith(actionOrSelector(store.getState())),
distinctUntilChanged()
].filter(Boolean);
return storeObservable.pipe.apply(storeObservable, operators);
return storeObservable.pipe(map(actionOrSelector), startWith(actionOrSelector(store.getState())), distinctUntilChanged());
}

@@ -48,0 +41,0 @@ };

@@ -33,4 +33,3 @@ 'use strict';

var storeObservable = rxjs.from(store);
return function (actionOrSelector, opts) {
var options = __assign({ initialValue: true }, opts);
return function (actionOrSelector) {
if (typeof actionOrSelector === 'string') {

@@ -43,9 +42,3 @@ return rxjs.Observable.create(function (listener) {

if (typeof actionOrSelector === 'function') {
var operators$$1 = [
operators.map(actionOrSelector),
options.initialValue &&
operators.startWith(actionOrSelector(store.getState())),
operators.distinctUntilChanged()
].filter(Boolean);
return storeObservable.pipe.apply(storeObservable, operators$$1);
return storeObservable.pipe(operators.map(actionOrSelector), operators.startWith(actionOrSelector(store.getState())), operators.distinctUntilChanged());
}

@@ -52,0 +45,0 @@ };

{
"name": "refract-redux-rxjs",
"version": "1.0.0-3",
"version": "1.0.0-4",
"main": "index.js",

@@ -5,0 +5,0 @@ "jsnext:main": "index.es.js",

@@ -11,5 +11,1 @@ export interface EnhancerOptions {

export type Selector<T> = (state: object) => T
export interface ObserveOptions {
initialValue: boolean
}
import refractEnhancer from './refractEnhancer'
import { EnhancerOptions, ObserveOptions } from './baseTypes'
import { EnhancerOptions } from './baseTypes'
export { refractEnhancer, EnhancerOptions, ObserveOptions }
export { refractEnhancer, EnhancerOptions }
import { from, Observable, PartialObserver as Listener } from 'rxjs'
import { map, distinctUntilChanged, startWith } from 'rxjs/operators'
import { Selector, ObserveOptions } from './baseTypes'
import { Selector } from './baseTypes'
import { Store } from 'redux'
export interface ObserveFn {
<T>(
actionTypeOrListener: string | Selector<T>,
options?: Partial<ObserveOptions>
): Observable<T>
<T>(actionTypeOrListener: string | Selector<T>): Observable<T>
}

@@ -16,7 +13,3 @@

return <T>(actionOrSelector, opts?: Partial<ObserveOptions>) => {
const options: ObserveOptions = {
initialValue: true,
...opts
}
return <T>(actionOrSelector) => {
if (typeof actionOrSelector === 'string') {

@@ -34,12 +27,9 @@ return Observable.create((listener: Partial<Listener<T>>) => {

if (typeof actionOrSelector === 'function') {
const operators = [
return storeObservable.pipe<T>(
map(actionOrSelector),
options.initialValue &&
startWith(actionOrSelector(store.getState())),
startWith(actionOrSelector(store.getState())),
distinctUntilChanged<T>()
].filter(Boolean)
return storeObservable.pipe<T>(...operators)
)
}
}
}

@@ -11,4 +11,1 @@ export interface EnhancerOptions {

export declare type Selector<T> = (state: object) => T
export interface ObserveOptions {
initialValue: boolean
}
import refractEnhancer from './refractEnhancer'
import { EnhancerOptions, ObserveOptions } from './baseTypes'
export { refractEnhancer, EnhancerOptions, ObserveOptions }
import { EnhancerOptions } from './baseTypes'
export { refractEnhancer, EnhancerOptions }
import { Observable } from 'rxjs'
import { Selector, ObserveOptions } from './baseTypes'
import { Selector } from './baseTypes'
export interface ObserveFn {
<T>(
actionTypeOrListener: string | Selector<T>,
options?: Partial<ObserveOptions>
): Observable<T>
<T>(actionTypeOrListener: string | Selector<T>): Observable<T>
}
export declare const observeFactory: (store: any) => ObserveFn
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc