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 lit = { | |
on: { | |
BREAK: "broken", | |
TOGGLE: "unlit" | |
} | |
}; | |
const unlit = { | |
on: { | |
BREAK: { |
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 React from 'react' | |
import { Field } from 'react-final-form' | |
const Fields = ({ | |
names, | |
subscription, | |
fieldsState = {}, | |
children, | |
originalRender, | |
}) => { |
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
{ StatusCode: 200, | |
FunctionError: 'Handled', | |
LogResult: 'U1RBUlQgUmVxdWVzdElkOiBkNjJmNGE1Yy1kNzZkLTExZTctYWU0Yy1kNWNlNTgzOGI2ZjAgVmVyc2lvbjogJExBVEVTVAoyMDE3LTEyLTAyVDE0OjM0OjAxLjAwMloJZDYyZjRhNWMtZDc2ZC0xMWU3LWFlNGMtZDVjZTU4MzhiNmYwCXsiZXJyb3JNZXNzYWdlIjoiRXJyb3Igc2NyYXBpbmcgbWlzc2lvbi1kb2xvcmVzLXBhcmstc2FuLWZyYW5jaXNjbzogXCJFcnJvciBwYXJzaW5nIHBhZ2U6IHt9XCIiLCJlcnJvclR5cGUiOiJFcnJvciIsInN0YWNrVHJhY2UiOlsiZ2V0UGFnZS50aGVuLnRoZW4udGhlbi5jYXRjaC5lcnJvciAoL3Zhci90YXNrL2hhbmRsZXIuanM6MjU6MTYpIiwidHJ5Q2F0Y2hlciAoL3Zhci90YXNrL25vZGVfbW9kdWxlcy9ibHVlYmlyZC9qcy9yZWxlYXNlL3V0aWwuanM6MTY6MjMpIiwiUHJvbWlzZS5fc2V0dGxlUHJvbWlzZUZyb21IYW5kbGVyICgvdmFyL3Rhc2svbm9kZV9tb2R1bGVzL2JsdWViaXJkL2pzL3JlbGVhc2UvcHJvbWlzZS5qczo1MTI6MzEpIiwiUHJvbWlzZS5fc2V0dGxlUHJvbWlzZSAoL3Zhci90YXNrL25vZGVfbW9kdWxlcy9ibHVlYmlyZC9qcy9yZWxlYXNlL3Byb21pc2UuanM6NTY5OjE4KSIsIlByb21pc2UuX3NldHRsZVByb21pc2UwICgvdmFyL3Rhc2svbm9kZV9tb2R1bGVzL2JsdWViaXJkL2pzL3JlbGVhc2UvcHJvbWlzZS5qczo2MTQ6MTApIiwiUHJvbWlzZS5fc2V0dGxlUHJvbWlzZXMgKC92YXIvdGFzay9ub2RlX21vZHV |
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 Just = v => ({ | |
isJust: true, | |
value: v | |
}); | |
const Nothing = { isJust: false }; | |
const last = xs => xs.length > 0 ? Just(xs[xs.length-1]) : Nothing; | |
const catMaybes = xs => xs.reduce((newList, m) => m.isJust && newList.push(m.value), []); | |
const flatten = () => this.reduce((newList, l) => newList.concat(l), []); | |
const compose = f => g => x => f(g(x)); | |
// ... |
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 CartPage({ items }) { | |
return items ? ( | |
<ul className="CartPage-items"> | |
{items.map(item => ( | |
<li key={item.id} className="CartPage-item"> | |
<Item item={item}> | |
<div className="CartItem-controls"> | |
<button className="CartItem-removeOne">–</button> | |
<span className="CartItem-count">{item.count}</span> | |
<button className="CartItem-addOne">+</button> |
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
<?php | |
if ( !defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* @hooked WC_Emails::email_header() Output the email header | |
*/ | |
do_action( 'woocommerce_email_header', $email_heading, $email ); ?> |
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
<?php | |
/** | |
* Admin new order email | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/emails/admin-new-order.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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 handleChange = (fieldName) => (event) => { | |
this.setState(fieldName, event.target.value) | |
} | |
<input type="text" onChange={handleChange('email')} ... /> |
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
// Functional setState (Recommended) | |
this.setState(prevState => { | |
const newState = { | |
...prevState.data, | |
transactions: [...data, prevState.data.transactions] | |
} | |
return { data: newState } | |
}) |
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 expect from 'expect'; | |
import * as courseActions from './courseActions'; | |
import * as types from './actionTypes'; | |
import thunk from 'redux-thunk'; | |
import nock from 'nock'; | |
import configureMockStore from 'redux-mock-store'; | |
// Test a sync action | |
describe('Course Actions', () => { |
NewerOlder