Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tfoxy on github.
  • I am tfoxy (https://keybase.io/tfoxy) on keybase.
  • I have a public key ASA_mtOvVfYhRgAK7D7N5ak_nc-v_VMlvmNg2UwhK7sb9go

To claim this, I am signing this object:

@tfoxy
tfoxy / vueApolloPatch.js
Created April 18, 2018 00:11
Patch VueApollo#prefetchQuery so that it works when calling `prefetchAll` on client
import { omit } from 'lodash';
import VueApollo from 'vue-apollo';
const VUE_APOLLO_QUERY_KEYWORDS = [
'variables',
'watch',
'update',
'result',
'error',
'loadingKey',
@tfoxy
tfoxy / makeExtractTextLoaderHot.js
Created June 7, 2017 19:20
Hot extract text loader plugin for webpack 1.x
const loaderUtils = require('loader-utils');
const extractTextLoader = require('extract-text-webpack-plugin/loader');
function hotExtractedCss() {
if (module.hot) {
module.hot.accept();
if (module.hot.data) {
console.log('Reloading css...');
Array.prototype.forEach.call(document.querySelectorAll('link[href][rel=stylesheet]'), function(link) {
var nextStyleHref = link.href.replace(/(\?\d+)?$/, '?' + Date.now());