This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { all, call, fork, put, take } from "redux-saga/effects"; | |
export const types = { | |
GET_PRODUCTS_REQUEST: "@products/GET_PRODUCTS_REQUEST", | |
GET_PRODUCTS_PROGRESS: "@products/GET_PRODUCTS_PROGRESS", | |
GET_PRODUCTS_SUCCESS: "@products/GET_PRODUCTS_SUCCESS", | |
GET_PRODUCTS_FAILURE: "@products/GET_PRODUCTS_FAILURE", | |
}; | |
export const actions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactReconciler from 'react-reconciler'; | |
import gui from 'gui'; | |
function traceWrap(hostConfig) { | |
let traceWrappedHostConfig = {}; | |
Object.keys(hostConfig).map(key => { | |
const func = hostConfig[key]; | |
traceWrappedHostConfig[key] = (...args) => { | |
console.trace(key); | |
return func(...args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactReconciler from 'react-reconciler'; | |
function traceWrap(hostConfig) { | |
let traceWrappedHostConfig = {}; | |
Object.keys(hostConfig).map(key => { | |
const func = hostConfig[key]; | |
traceWrappedHostConfig[key] = (...args) => { | |
console.trace(key); | |
return func(...args); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactReconciler from 'react-reconciler'; | |
function traceWrap(hostConfig) { | |
let traceWrappedHostConfig = {}; | |
Object.keys(hostConfig).map(key => { | |
const func = hostConfig[key]; | |
traceWrappedHostConfig[key] = (...args) => { | |
console.trace(key); | |
return func(...args); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class View extends Component { | |
render() { | |
return ( | |
<view | |
style={{ | |
display: 'flex', | |
flexDirection: 'column', | |
...this.props.style |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createInstance: (type, newProps, rootContainerInstance, _currentHostContext, workInProgress) => { | |
const domElement = document.createElement('div'); | |
Object.keys(newProps).forEach(propName => { | |
const propValue = newProps[propName]; | |
if (propName === 'children') { | |
if (type !== 'text') { | |
if (typeof propValue === 'string' || typeof propValue === 'number') { | |
throw new Error('Text strings must be rendered within a <Text> component.'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import View from './view'; | |
import Text from './text'; | |
class App extends Component { | |
render() { | |
return ( | |
<View | |
style={{ | |
flex: 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rootHostContext = {}; | |
const childHostContext = {}; | |
const hostConfig = { | |
now: Date.now, | |
getRootHostContext: () => { | |
return rootHostContext; | |
}, | |
prepareForCommit: () => {}, | |
resetAfterCommit: () => {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
counter: 0 | |
}; |
NewerOlder