Skip to content

Commit 901cf9e

Browse files
committed
0.6.2
1 parent 1865361 commit 901cf9e

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

lib/__tests__/react-most-test.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ describe('react-most', () => {
241241
</Most>
242242
)
243243
let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter)
244-
dispatch([{type:'inc3'},
245-
{type:'inc3'}], counter)
244+
do$([
245+
counter.actions.inc3,
246+
counter.actions.inc3,
247+
])
246248
return historyStreamOf(counter)
247249
.take$(2)
248250
.then(state=>expect(state.count).toEqual(6))

lib/react-most.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,17 @@ function actionsAndSinks(sinks, self){
121121
}
122122
};
123123
for(let name in sinks){
124-
if(observable(sinks[name])){
125-
_sinks.push(sinks[name]);
126-
} else if(sinks[name] instanceof Function){
124+
let value = sinks[name]
125+
if(observable(value)){
126+
_sinks.push(value);
127+
} else if(value instanceof Function){
127128
_actions[name] = (...args)=>{
128-
return self.context[INTENT_STREAM].send(sinks[name].apply(self, args));
129+
return self.context[INTENT_STREAM].send(value.apply(self, args));
129130
}
130131
} else if(name === 'actions') {
131-
for(let a in sinks[name])
132+
for(let a in value)
132133
_actions[a] = (...args)=>{
133-
return self.context[INTENT_STREAM].send(a.apply(self, args));
134+
return self.context[INTENT_STREAM].send(value[a].apply(self, args));
134135
}
135136
}
136137
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-most",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "High Prefomance Monadic Reactive State Container for React",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)