This file contains hidden or 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 tp from 'timeproxy'; | |
| const REQUEST_TIMEOUT = tp`twenty seconds`; | |
| const COOKIE_EXPIRY_TIME = tp`1 week`; | |
| const DEBOUNCE_PERIOD = tp`.5 seconds`; |
This file contains hidden or 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 { FormValidation } from 'calidation'; | |
| const config = { | |
| username: { | |
| isRequired: 'You need a username', | |
| }, | |
| email: { | |
| isRequired: 'We need your email', | |
| isEmail: 'We need a valid email, too', | |
| }, |
This file contains hidden or 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 tp from 'timeproxy'; | |
| const SESSION_EXPIRES = tp.IN_THIRTY_SECONDS; | |
| const OLD_POST_TIMESTAMP = tp.TWO_WEEKS_AGO; |
This file contains hidden or 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 tp from 'timeproxy'; | |
| const TIME_UNTIL_NEXT_PUSH = tp.ONE_WEEK_AND_A_DAY; | |
| const SHOW_DONT_LEAVE_DELAY = tp.TWELVE_MINUTES_TWO_SECONDS; | |
| const WOW = tp.NINE_WEEKS_TWELVE_DAYS_SEVEN_MINUTES_AND_HALF_A_SECOND; |
This file contains hidden or 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 tp from 'timeproxy'; | |
| const REQUEST_TIMEOUT = tp.TWENTY_SECONDS; | |
| const COOKIE_EXPIRY_TIME = tp.A_WEEK; | |
| const DEBOUNCE_PERIOD = tp.HALF_A_SECOND; |
This file contains hidden or 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 REQUEST_TIMEOUT = 1000 * 20; | |
| const COOKIE_EXPIRY_TIME = 1000 * 60 * 60 * 24 * 7; | |
| const DEBOUNCE_PERIOD = 500; |
This file contains hidden or 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 { showSnackbar } from './actions'; | |
| const isLocalhost = Boolean( | |
| window.location.hostname === 'localhost' || | |
| // [::1] is the IPv6 localhost address. | |
| window.location.hostname === '[::1]' || | |
| // 127.0.0.1/8 is considered localhost for IPv4. | |
| window.location.hostname.match( | |
| /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ | |
| ) | |
| ); |
This file contains hidden or 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 Case from 'case'; | |
| export const createAction = name => ({ | |
| [Case.constant(name)]: Case.constant(name), | |
| [Case.camel(name)]: payload => ({ | |
| type: Case.constant(name), | |
| payload, | |
| }), | |
| }); | |
| export const createNetworkAction = name => ({ |
This file contains hidden or 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
| <snippet> | |
| <content><![CDATA[ | |
| export const ${1:ACTION_NAME} = '${1}'; | |
| export const ${1/(?<=[^\W_])_+([^\W_])|([^\W_]+)|_+/\U$1\L$2/g} = ${2:opts} => ({ | |
| type: ${1},${3:} | |
| }); | |
| ]]></content> | |
| <tabTrigger>action</tabTrigger> | |
| </snippet> |
This file contains hidden or 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 express = require('express'); | |
| require('babel-register')({ | |
| ignore: /\/(build|node_modules|.svg)\//, | |
| presets: ['env', 'react-app'] | |
| }); | |
| const universal = require('./universal'); | |
| const app = express(); |