Skip to content

Instantly share code, notes, and snippets.

Yoav Ganbar hamatoyogi

Block or report user

Report or block hamatoyogi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SC-bsgen.js
@observer
export default class extends React.Component {
constructor() { ... } // for brevity
// define the data we want to "watch"
@observable chosenPhrase = this.randomPhrases[0];
@observable counter = 0;
// define an "action" -> we are saying what that we want to change a peice of "watched" data
@action
View styled-components-demo.js
import styled from 'styled-components';
// some overly styled button
const MyButton = styled.button`
   background: #3d94f6;
   background-image: linear-gradient(to bottom, #3d94f6, #1e62d0);
   border-radius: 20px;
   color: #ffffff;
   font-family: Open Sans;
View mobx-simple-example.js
import React from 'react';
import { observable, action } from 'mobx';
import { observer } from 'mobx-react';
@observer
export default class extends React.Component {
constructor() {
super();
this.randomPhrases = [
View next-js-simple-article.js
export default class Article extends Component {
// notice that it's an async function
static async getInitialProps () {
// fetch data on the server and parse it to JSON
const res = await
fetch('http://localhost:3000/wp-json/wp/v2/articles/1316999');
const json = await res.json();
View yuval-js-2.js
const arbitraryDataList = [{
rootId: 'false'
},
{
root: {
field1: 'val1'
}
},
{
root: {
You can’t perform that action at this time.