Skip to content

Instantly share code, notes, and snippets.

import 'rxjs';
import { Observable } from 'rxjs';
Observable.prototype.debug = function(_message) {
const message = `EpicDebug: ${_message}`;
return this.do(
function(next) {
if (__DEV__) {
@braco
braco / gutenberg-module.js
Last active June 30, 2019 20:01
Repeating components in Wordpress Gutenberg
```
edit: repeater({
editing: true,
renderComponent: ({ attributes: { name }, setAttributes }) =>
<MyComponent
name={
<PlainText
value={ name }
placeholder={'Name'}
onChange={ value => setAttributes( { name: value } ) }
@braco
braco / ParseHTML.js
Created December 13, 2018 19:38
Gatsby + Wordpress reparser
import React from 'react';
import ReactHtmlParser, { processNodes } from 'react-html-parser';
import generatePropsFromAttributes from 'react-html-parser/lib/utils/generatePropsFromAttributes';
import ModuleName from 'mymodules/ModuleName';
// This module lowercases tags, why?
const overrideComponents = {
modulename: ModuleName,
}