Skip to content

Commit

Permalink
add debugging console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavew committed Dec 12, 2016
1 parent 76bbd00 commit 00ae13f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
14 changes: 6 additions & 8 deletions src/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,17 @@ class Timeline extends Component {
this.setState({ history: historyArray });
})
this.props.dispatchObservableFn(currentlyDragging);
document.getElementById('timeline').addEventListener('mouseleave', (x) => {
this.listener = document.getElementById('timeline').addEventListener('mouseleave', (x) => {
this.props.dispatch(mouseLeave());
console.log('mouseleft')
});
// const mouseLeave = Rx.Observable.fromEvent(document.getElementById('timeline'), 'mouseleave')
// .map(event => {
// console.log('mouseleave');
// this.props.dispatch(stopDrag());
// });
// }
}

compomentWillUnmount() {
document.getElementById('timeline').removeEventListener(this.listener);
}

render() {
console.log('timeline receiving props', this.props);
const units = this.state.history.map((node, index) => {
return <TimelineUnit key={index} styles={UNIT_STYLES} index={index} timeTravel={this.timeTravelToPointN} />
})
Expand Down
2 changes: 1 addition & 1 deletion src/TimelineUnit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import reactiveComponent from './reactiveComponent.js';
import Rx from 'rxjs/Rx';

const TimelineUnit = (props) => {
console.log('unit received props', props);
const {dragging, index, timeTravel, styles} = props;
const handleMouseEnter = () => {
console.log('mouse entered, dragging is ', dragging);
dragging ? timeTravel(index) : undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion src/actionStreams.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const currentlyDragging = (superstream) => superstream.filter(x => x.type === 'M
if (val === 'slider') return !dragging;
if (val === 'nonslider' || val === 'stop') return false;
}, false)
.map(dragging => (console.log('dragging', dragging), dragging ? startDrag() : stopDrag()))
.map(dragging => dragging ? startDrag() : stopDrag())

const dragMovement = (superstream) => {
return superstream.filterForActionTypes('STOP_DRAG', 'START_DRAG')
Expand Down
1 change: 0 additions & 1 deletion src/omnistream.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class Omnistream {

// Creates a state-stream with provided reducer and action stream
createStatestream(reducer, actionStream) {
console.log('actionSTream', actionStream);
return actionStream(this)
.merge(this.stream.filter(value => value ? value._clearState : false))
.startWith(reducer(undefined, { type: null }))
Expand Down
1 change: 0 additions & 1 deletion src/reducer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function dragReducer(state = { dragging: false }, action) {
console.log('received action', action);
switch (action.type) {
case 'STOP_DRAG':
return Object.assign({}, state, { dragging: false })
Expand Down

0 comments on commit 00ae13f

Please sign in to comment.