type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| import { CacheLong } from '@shopify/hydrogen'; | |
| interface Config { | |
| cacheControl: string; | |
| removeNoIndex: boolean; | |
| updateCanonical: boolean; | |
| ignoreRedirects: boolean; | |
| } | |
| const config: Config = { |
| import PropTypes from 'prop-types'; | |
| type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; | |
| type Defined<T> = T extends undefined ? never : T; | |
| /** | |
| * Get the type that represents the props with the defaultProps included. | |
| * | |
| * Alternatively, we could have done something like this: |
| # When using RN in combination with Cocoapods, a lot of | |
| # things are broken. These are the fixes we had to append | |
| # to our Podfile when upgrading to [email protected]. | |
| # | |
| # WARNING: Check those line numbers when you're on a different version! | |
| def change_lines_in_file(file_path, &change) | |
| print "Fixing #{file_path}...\n" | |
| contents = [] |
| // ts 3.6x | |
| function debounce<T extends Function>(cb: T, wait = 20) { | |
| let h = 0; | |
| let callable = (...args: any) => { | |
| clearTimeout(h); | |
| h = setTimeout(() => cb(...args), wait); | |
| }; | |
| return <T>(<any>callable); | |
| } |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| /** | |
| * SystemJS hook that caches load and transpilation results of sources that haven't changed in IndexedDB storage. | |
| * In Chrome dev tools the cache is easily managed under Resources > IndexedDB > jspm | |
| * There's a global dependency on Dexie.js (ex: //npmcdn.com/[email protected]/dist/dexie.min.js) | |
| * Add the following to your index.ghtml <script src="http://npmcdn.com/[email protected]/dist/dexie.min.js"></script> | |
| * Adapted from https://gist.github.com/ineentho/70303c2ccdb69ad3661d | |
| */ | |
| ;(function(){ | |
| var db = new Dexie("jspm"); | |
| db.version(1).stores({ files: "&url,format,hash,contents" }); |
| export default function renderRoute(request, reply) { | |
| const store = configureStore(); | |
| store.dispatch(match(request.path, (error, redirectLocation, routerState) => { | |
| if (redirectLocation) { | |
| reply.redirect(redirectLocation.pathname + redirectLocation.search); | |
| } else if (error) { | |
| reply(error.message).code(500); | |
| } else if (!routerState) { | |
| reply('Not found').code(404); | |
| } else { |
If you encounter the following:
GitHub rate limit reached. To increase the limit use GitHub authentication.
Run jspm endpoint config github to set this up.
Sources :
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| var Bar1 = base => class extends base { | |
| componentWillMount(){ | |
| super.componentWillMount(); | |
| console.log('Bar1'); | |
| } | |
| }; | |
| var Bar2 = base => class extends base { | |
| componentWillMount(){ | |
| super.componentWillMount(); |