Comparing version 0.14.0-rc.3 to 0.14.0-rc.4
@@ -8,2 +8,3 @@ # Changelog | ||
* Make reducers full-featured store elements (add `.get()`, `.set(x)` and `.map(fn)` methods) | ||
* Add observable declaration to effects, events and reducers, which allow interop in this way: `from(effect)` | ||
@@ -10,0 +11,0 @@ ## 0.13.0 |
@@ -1350,3 +1350,4 @@ 'use strict'; | ||
reset, | ||
lastState | ||
lastState, | ||
subscribe | ||
}); | ||
@@ -1359,2 +1360,9 @@ const returnType = thisType ? thisType : reducer; | ||
function subscribe(subscriber) { | ||
invariant(typeof subscriber.next === 'function', 'wrong subscriber'); | ||
return { | ||
unsubscribe: lastState.watch(_ => subscriber.next(_)) | ||
}; | ||
} | ||
function map(fn) { | ||
@@ -1361,0 +1369,0 @@ const state = lastState.map(fn); |
@@ -1344,3 +1344,4 @@ import { sync } from 'most-subject'; | ||
reset, | ||
lastState | ||
lastState, | ||
subscribe | ||
}); | ||
@@ -1353,2 +1354,9 @@ const returnType = thisType ? thisType : reducer; | ||
function subscribe(subscriber) { | ||
invariant(typeof subscriber.next === 'function', 'wrong subscriber'); | ||
return { | ||
unsubscribe: lastState.watch(_ => subscriber.next(_)) | ||
}; | ||
} | ||
function map(fn) { | ||
@@ -1355,0 +1363,0 @@ const state = lastState.map(fn); |
@@ -32,2 +32,13 @@ | ||
export type Subscription = { | ||
unsubscribe(): void, | ||
} | ||
export type Subscriber<A> = { | ||
next(value: A): void, | ||
// error(err: Error): void, | ||
complete(): void, | ||
} | ||
export type Store<T> = { | ||
@@ -50,2 +61,3 @@ subscribe(listner: () => void): () => void, | ||
reset<A extends Event<any, any>>(event: A | A[]): Reducer<S>, | ||
subscribe(subscriber: Subscriber<S>): Subscription, | ||
} | ||
@@ -69,12 +81,2 @@ | ||
export type Subscription = { | ||
unsubscribe(): void, | ||
} | ||
export type Subscriber<A> = { | ||
next(value: A): void, | ||
// error(err: Error): void, | ||
complete(): void, | ||
} | ||
export type Event<Payload, State> = { | ||
@@ -81,0 +83,0 @@ (params: Payload): { |
{ | ||
"name": "effector", | ||
"version": "0.14.0-rc.3", | ||
"version": "0.14.0-rc.4", | ||
"description": "Reactive state manager", | ||
@@ -5,0 +5,0 @@ "main": "effector.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244437
2816