This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Basic saga that revokes session and redirects to /login | |
* each time a LOGOUT action is dispatched | |
*/ | |
function* logoutSaga() { | |
while (true) { | |
yield take(LOGOUT) | |
yield put(revokeSession()) | |
yield put(redirect('/login')) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React, { Component } from 'react' | |
import BrowserHistory from 'react-history/BrowserHistory' | |
import { Push } from 'react-history' | |
import { StaticRouter } from 'react-router' | |
/** | |
* ControlledRouter, greatly inspired by https://gist.github.com/donnanicolas/3d76397a92551f449637590bf0413133 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="mouse" style="width:10px; height: 10px; background: red; position: absolute;"></div> | |
<script type="text/javascript"> | |
setTimeout(function () { | |
var $ = jQuery; | |
$(document).mousemove(function (e) { | |
$('#mouse').css({ top: e.clientY + 1, left: e.clientX + 1}); | |
}); | |
}, 1000); | |
</script> |