This file contains hidden or 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
<script> | |
import { createStore } from './fakeRedux.js' | |
let count = 0 | |
const stateModifiers = { | |
DECREMENT: () => { | |
count -= 1 | |
}, | |
INCREMENT: () => { |
This file contains hidden or 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
let previousColor | |
let previousValue | |
let timeoutId | |
const queueUpdate = () => { | |
if ( | |
previousColor === color | |
&& previousValue === value | |
) { | |
return |
This file contains hidden or 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
<script> | |
let previousColor | |
let previousValue | |
let timeoutId | |
const queueUpdate = () => { | |
if ( | |
previousColor === color | |
&& previousValue === value |
This file contains hidden or 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
function create() { | |
div = element("div"); | |
t = text(ctx.value); | |
set_style(div, "color", ctx.color); | |
set_style(div, "left", "" + ctx.x + "ch"); | |
set_style(div, "position", "absolute"); | |
set_style(div, "top", "" + ctx.y + "em"); | |
add_location(div, file, 47, 0, 754); | |
} |
This file contains hidden or 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 | |
style=" | |
color: {color}; | |
left: {x}ch; | |
position: absolute; | |
top: {y}em; | |
" | |
> | |
{value} | |
</div> |
This file contains hidden or 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
/* Type the word "exit" in any point of your page... */ | |
(function () { | |
const sSecret = /* Choose your hidden word...: */ "exit"; | |
let nOffset = 0; | |
document.onkeypress = function(oPEvt) { | |
let oEvent = oPEvt || window.event, | |
nChr = oEvent.charCode, | |
sNodeType = oEvent.target.nodeName.toUpperCase(); |
This file contains hidden or 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
const codeSequenceEpic = ( | |
action$, | |
) => ( | |
action$ | |
.pipe( | |
ofType('START_CODE_SEQUENCE_LISTENER'), | |
mergeMap(({ | |
codeSequence, | |
}) => ( | |
action$ |
This file contains hidden or 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
var store = ( | |
createStore(stateModifiers) | |
) | |
store | |
.subscribe([ | |
initMiddleware, | |
loadingMiddleware, | |
]) |
This file contains hidden or 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
const stateModifiers = { | |
UPDATE_IDS: function(action) { | |
vm.ids = action.ids | |
}, | |
} | |
const statelessReduxReducer = ( | |
state, | |
action, | |
) => { |
This file contains hidden or 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
var loadingMiddleware = function(action) { | |
if (action.type === 'GET_IDS') { | |
dispatch({ | |
type: 'LOADING', | |
}) | |
} | |
if (action.type === 'UPDATE_IDS') { | |
dispatch({ | |
type: 'LOADED', |