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 PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | |
import layout from '../containers/layout'; | |
import * as selectors from '../selectors/operations'; | |
import { getItems, changeOperationStatus, getHeaders, paginate } from '../actions/operations'; | |
import isDefined from '../utils/is-defined'; | |
import Content from '../components/operations/content'; |
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
// Composed with loadableHOX(HOReducers: { replace, update, patch }, storeKeys: { error, loading, data }) | |
import { Map, List } from 'immutable'; | |
import * as loadable from './common/loadable'; | |
const updatePage = loadable.createReducer(); | |
const updateHeaders = loadable.createReducer(); | |
const updateSelectedItems = loadable.createReducer(); | |
/** |
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
async function foo () { | |
const response = await request(url) | |
/* not null or undefined */ | |
if (!response) throw new Error(‘no_data’) | |
return response; | |
} | |
foo().then(just, nothing) |
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 { Iterable, Map, List } from 'immutable'; | |
// add fast getter into immutable | |
const accesor = new Proxy(Object.prototype, { | |
get: (target, property, receiver) => target.get(property), | |
}); | |
Object.setPrototypeOf(Iterable.prototype, accesor); | |
// now you can do: | |
const m = Map({ a: 1 }); |
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
{ | |
console.log(a); // ReferenceError | |
const a = 1; | |
} | |
{ | |
const f = () => console.log(a); | |
const a = 1; | |
f() // → 1 | |
} |
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
(() => { | |
// todo: mixins collection | |
class Foo { | |
foo() { | |
console.log(this.bar()); | |
} | |
bar() { console.log('bar'); return 42 } | |
} | |
const SomeMixin = { |
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
// @props Array<T> list1, list2 | |
// Assumptions: lists're sorted; T is primitive | |
// @returns { mergedItems, commonItems, list1Uniqs, list2Uniqs } | |
function mergeLists (list1, list2, options = {}) { | |
let { | |
compare = (a, b) => b - a, // todo: compare strings | |
mergedItems = [], | |
commonItems = [], | |
} = options; |
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
{ | |
// ... | |
output: { | |
path: path.resolve(__dirname, 'build'), | |
library: 'lib', | |
filename: 'main.js', | |
libraryTarget: 'commonjs', | |
} | |
externals: { | |
react: { |
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
class Link extends PureComponent { | |
render () { | |
// Unusual useful omit application | |
const rest = omit(this.props, [ | |
'url', 'basePath', 'RouterLink', 'method', 'currentTab', 'disabled', 'children', 'className', | |
'title', 'confirm', 'onClick', 'onSuccess', 'onFailure', 'axiosProps', 'noExternalIcon', | |
]); | |
return isExternalUrl(this.props.url) | |
? this.renderExternalLink({ rest }) | |
: this.renderInternalLink({ rest }); |
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
я календарь переверну и снова | |
в действительности все не так как на самом деле | |
Т-0,66 5ВА КЛ.0,5 1000/5 М 3/В ЯЩ. | |
€40.35 | |
жк | |
жк с парковкой для теслы | |
за что казнили изобретателя гильотины | |
за одно | |
вы стали тимлидом | |
жк солнечная система |