See here instead https://github.com/vsavkin/ngselectors
Say we have a store defined as follows:
export class Store {
Say we have a store defined as follows:
export class Store {
const fieldValidations = [ | |
ruleRunner("name", "Name", required), | |
ruleRunner("emailAddress", "Email Address", required), | |
ruleRunner("password1", "Password", required, minLength(6)), | |
ruleRunner("password2", "Password Confirmation", mustMatch("password1", "Password")) | |
]; | |
export default class CreateAccount extends React.Component { | |
constructor() { | |
// ... |
UIFont.familyNames.forEach({ familyName in | |
let fontNames = UIFont.fontNames(forFamilyName: familyName) | |
print(familyName, fontNames) | |
}) |
#!/bin/bash | |
# Based on http://stackoverflow.com/questions/151677/tool-for-adding-license-headers-to-source-files | |
for i in *.js | |
do | |
if ! grep -q @flow $i | |
then | |
(echo "" & echo "/* @flow */") > flowificator | |
cat flowificator $i >$i.new && mv $i.new $i | |
rm flowificator |
import React from "react"; | |
import { withRouter } from "react-router"; | |
class Test extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
}; | |
} | |
componentWillReceiveProps(nextProps) { |
public static class MockExtensions | |
{ | |
public static IReturnsResult<T> NotifyPropertyChanged<T, TResult>(this Mock<T> mock, Expression<Func<T, TResult>> expression, TResult setupValue) where T : class, INotifyPropertyChanged | |
{ | |
var memberExpression = expression.Body as MemberExpression; | |
if (memberExpression == null) throw new ArgumentException("expression.Body is not MemberExpression"); | |
var returnResult = mock.Setup(expression).Returns(setupValue); | |
mock.Raise(m => m.PropertyChanged += null, new PropertyChangedEventArgs(memberExpression.Member.Name)); |
import withRouter from './utils/withRouter'; | |
const MyComponent = ({ history }) => | |
<button onClick={() => history.goBack()}>Back</button> | |
export default compose( | |
withRouter, | |
)(MyComponent); |
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
try { | |
eval(str); | |
} catch(e) { | |
alert('Your browser does not support ES6!') | |
} |
//Usage | |
import React from 'react'; | |
import { BrowserRouter as Router } from 'react-router-dom'; | |
import Route from './AuthRoute'; | |
import Login from './Login'; | |
import Private from './Private'; | |
export default () => | |
<Router> |