To define your validation rules, provide a Map
. Keys are field names, values are either a validation rule, or an array of validation rules.
// one rule
const rules = new Map([
['name', required]
])
// multiple rules
const rules = new Map([
import { Component, PropTypes } from 'react' | |
import { connect } from 'react-redux' | |
import { transitionTo } from 'redux-react-router' | |
const NEXT_URL = 'REDIRECTOR(NEXT_URL)' | |
const CLEAR_NEXT_URL = 'REDIRECTOR(CLEAR_NEXT_URL)' | |
export const transitionNext = url => ({ type: NEXT_URL, payload: url }) | |
export const clearNextUrl = () => ({ type: CLEAR_NEXT_URL }) |
To define your validation rules, provide a Map
. Keys are field names, values are either a validation rule, or an array of validation rules.
// one rule
const rules = new Map([
['name', required]
])
// multiple rules
const rules = new Map([
Inside config.xml
add the following attribute to the widget
element:
xmlns:android="http://schemas.android.com/apk/res/android"
(For example, it looks like this for me:)
jQuery("ul.popover.level0").menuAim({ | |
activate: function(row) { jQuery(row).addClass('active') }, | |
deactivate: function(row) { jQuery(row).removeClass('active') }, | |
rowSelector: 'li.level1.parent', | |
exitMenu: function() { return true; } | |
}); |
<?php | |
namespace param { | |
class QueryParam { | |
const SINGLE = 'single'; | |
const MANY = 'many'; | |
const MANY_CSV = 'csv'; | |
public $queryField; | |
private $nullable = false; |
<?php namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
/** | |
* If the incoming request is an OPTIONS request | |
* we will register a handler for the requested route | |
*/ | |
class CatchAllOptionsRequestsProvider extends ServiceProvider { |
@ngInject('bus', '$ionicModal') | |
class Adder { | |
constructor(num) { | |
this.num = num | |
} | |
// order matters | |
// if you @swallow first, then @log won't log caught exceptions | |
@log | |
@swallow |
// note there may be a better way to abuse flexbox than this :) | |
var React = require('react-native') | |
var { View, TextInput } = React | |
var BorderedInput = React.createClass({ | |
getInitialState() { | |
return { i: 0 } | |
}, |
async function sleep(ms) { | |
return new Promise(r => setTimeout(r, ms)) | |
} | |
async function foo() { console.log('s foo'); await sleep(2000); console.log('d foo'); return 'foo'; } | |
async function bar() { console.log('s bar'); await sleep(1000); console.log('d bar'); return 'bar'; } | |
async function baz() { console.log('s baz'); await sleep(2000); console.log('d baz'); return 'baz'; } | |
async function run() { | |
console.log('start') |