@@ -4,7 +4,7 @@ import * as TestUtils from 'react-addons-test-utils';
4
4
import * as most from 'most' ;
5
5
6
6
import Most , { connect , REACT_MOST_ENGINE } from '../../src/react-most' ;
7
- import { EngineSubject } from '../../src/interfaces '
7
+ import { Subject } from 'most-subject '
8
8
import {
9
9
stateStreamOf , stateHistoryOf ,
10
10
intentStreamOf , intentHistoryOf ,
@@ -32,14 +32,14 @@ interface Intent {
32
32
type : string
33
33
value ?: any
34
34
}
35
- const counterWrapper = connect ( ( intent$ : EngineSubject < Intent > ) => {
35
+ const counterWrapper = connect ( ( intent$ : Subject < Intent > ) => {
36
36
return {
37
37
update$ : intent$ . map ( ( intent : Intent ) => {
38
38
switch ( intent . type ) {
39
39
case 'inc' :
40
40
return state => ( { count : state . count + 1 } )
41
41
case 'dec' :
42
- intent$ . send ( { type : 'dec triggered' } )
42
+ intent$ . next ( { type : 'dec triggered' } )
43
43
return state => ( { count : state . count - 1 } )
44
44
case 'changeWrapperProps' :
45
45
return state => ( {
@@ -188,7 +188,7 @@ describe('react-most', () => {
188
188
} )
189
189
190
190
describe ( 'composable' , ( ) => {
191
- const counterWrapper2 = connect ( ( intent$ : EngineSubject < Intent > ) => {
191
+ const counterWrapper2 = connect ( ( intent$ : Subject < Intent > ) => {
192
192
return {
193
193
update$ : intent$ . map ( intent => {
194
194
switch ( intent . type ) {
@@ -225,7 +225,7 @@ describe('react-most', () => {
225
225
} )
226
226
227
227
describe ( 'convension default to `action` field in sinks' , ( ) => {
228
- const Counter = connect ( ( intent$ : EngineSubject < Intent > ) => {
228
+ const Counter = connect ( ( intent$ : Subject < Intent > ) => {
229
229
return {
230
230
update$ : intent$ . map ( intent => {
231
231
switch ( intent . type ) {
@@ -255,7 +255,7 @@ describe('react-most', () => {
255
255
} )
256
256
257
257
describe ( 'ERROR' , ( ) => {
258
- const Counter = connect ( ( intent$ : EngineSubject < Intent > ) => {
258
+ const Counter = connect ( ( intent$ : Subject < Intent > ) => {
259
259
return {
260
260
update$ : intent$ . map ( intent => {
261
261
switch ( intent . type ) {
@@ -303,9 +303,9 @@ describe('react-most', () => {
303
303
304
304
describe ( 'unsubscribe when component unmounted' , ( ) => {
305
305
it ( 'unsubscribe' , ( done ) => {
306
- const Counter = connect ( ( intent$ : EngineSubject < Intent > ) => {
306
+ const Counter = connect ( ( intent$ : Subject < Intent > ) => {
307
307
let incForever$ = most . periodic ( 100 , { type : 'inc' } ) . map ( intent => {
308
- done . fail ( 'should not send intent any more' )
308
+ done . fail ( 'should not next intent any more' )
309
309
return _ => _
310
310
} )
311
311
return {
0 commit comments