Skip to content

Instantly share code, notes, and snippets.

View simon-robertson's full-sized avatar

Simon Robertson simon-robertson

View GitHub Profile
@simon-robertson
simon-robertson / vsc-status-bar-colour.txt
Last active August 14, 2020 14:50
VSC Status Bar Colour
// 1. Search for "workbench color" in the VSC settings panel
// 2. Select "Edit in settings.json" for "Color Customizations" setting
// 3. Add the following to the "settings.json" file
"workbench.colorCustomizations": {
"statusBar.background": "#323232",
"statusBar.foreground": "#e0e0e0"
}
// No more nasty blue status bar :)
//
// component class
//
import React from 'react'
import { CounterTest } from 'app/stores'
export class Example extends React.Component {
componentDidMount() {
CounterTest.subscribe(this)
//
// app/state/TestCounter.js
//
// Contains partial application state, a bit like a small Redux store.
// It is a standard class with static fields and methods.
//
import { store } from 'app/decorators';
@store
@simon-robertson
simon-robertson / useLifeCycle.js
Created October 29, 2018 13:23
React 16.7.0-alpha `useLifeCycle` hook
export const useLifeCycle = (initialize, values) => {
const { mount, unmount, update } = useMemo(initialize, []);
useEffect(() => {
if (typeof mount === 'function') {
mount(values);
}
return () => {
if (typeof unmount === 'function') {