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
// tohle je prostě entry point pro kód buďto webovej nebo nativní - můžeš udělat kolik endpointů chceš pro jako platformu | |
import * as actions from './actions' | |
import { createStore } from 'redux' | |
// v native-entry.js si requirneš jinej router prostě, zbytek bude prakticky stejnej | |
import Router from 'router' | |
import routes from 'routes' | |
import { Provider } from 'redux-react' | |
Router.config({ routes }) |
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
function asyncIter(arr, fn, errCb) { | |
var i = 0 | |
function runIt() { | |
try { | |
fn(arr[i], i, function() { | |
i++ | |
if (i < arr.length) { | |
setTimeout(runIt, 5) | |
} |
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
//pohoda, žádnej callback | |
const fn = (props) => { | |
return div({ | |
}, props.text) | |
} | |
// budu chtít zařídit to, aby se po kliknutí něco stalo | |
props.onClick = (event) => { //pičoviny } |
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
// template.php | |
<ul class="posts"> | |
<?php foreach ($properties['posts'] as $post): ?> | |
<li> | |
<?= $post->title ?> | |
</li> | |
<?php endif; ?> | |
</ul> | |
// does this seem to you as crazy?! |
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
// K čemu to je? | |
// Varianta 1. importování | |
import classes from './styles' | |
export default ({ visible }) => { | |
return ( | |
<div className={visible ? classes.visible : classes.invisible}>This is some text</div> | |
) |
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
// K čemu to je? | |
// Varianta 1. importování | |
import classes from './styles' | |
export default ({ visible }) => { | |
return ( | |
<div className={visible ? classes.visible : classes.invisible}>This is some text</div> | |
) |
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 style = Stylesheet.create({ | |
visible: { | |
display: block, | |
color: 'red', | |
}, | |
invisible: { | |
display: none, | |
}, | |
}) |
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 classes from './styles' | |
export default ({ visible }) => { | |
return ( | |
<div className={visible ? classes.visible : classes.invisible}>This is some text</div> | |
) | |
} |
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 asyncFn = (email) => { | |
return new Promise((resolve, reject) => { | |
$.get('//idnes.cz/' + email, (err, result) => { | |
if (err) { | |
return resolve({ | |
status: 'fail', | |
email: email, | |
}) | |
} | |
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 from 'react' | |
export default class React extends React.Component { | |
state = this._getState(this.props) | |
_getState() { | |
return { | |
shouldDisplayOnboarding: this.context.onboardingStore.shouldDisplayCommonOnboarding(this.props.appLocation) |