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
const contains = (s1, s2) => ( | |
((letn) => ( | |
letn( | |
[ | |
[...s1], | |
[...s2], | |
], | |
(a1, a2) => Boolean( | |
a1.reduce((a, c, i) => ( | |
(a) |
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
function cleanup(node) { | |
const removeMe = | |
node instanceof Image | |
|| node instanceof Text | |
|| node instanceof Comment | |
|| node.tagName === 'svg' | |
|| node.tagName === 'iframe'; | |
const ignoreChilds = | |
node.tagName === 'svg' |
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
import * as React from 'react'; | |
class App extends React.Component{ | |
portals = createPortals(); | |
render() { | |
const {PortalIn, PortalOut} = this.portals; | |
return ( |
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
export default function asyncReducer(state = isLoading, { type, payload }) { | |
switch (type) { | |
case AJAX_CALL_BEGIN: | |
return { ...state, [payload]: 1}; | |
case AJAX_CALL_SUCCESS: | |
return { ...state, [payload]: 0}; | |
case AJAX_CALL_ERROR: | |
return { ...state, [payload.target]: 0, error: payload.error }; |
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
export default function asyncReducer(state = isLoading, { type, payload }) { | |
switch (type) { | |
case AJAX_CALL_BEGIN: | |
if (payload === 'comments') { | |
return { ...state, comments: 1 }; | |
} | |
return { ...state, product: 1 }; | |
case AJAX_CALL_SUCCESS: | |
if (payload === 'comments') { |
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
// this: | |
if (access_granted): | |
send_declaration_of_war() | |
launch_nuclear_missiles() | |
// or this: | |
if (access_granted): | |
send_declaration_of_war() | |
launch_nuclear_missiles() |
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
if (access_granted) | |
send_declaration_of_war() | |
launch_nuclear_missiles() |