This file contains 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 { Editor } from 'react-draft-wysiwyg'; | |
import { ContentState,EditorState,convertFromHTML } from 'draft-js'; | |
import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css'; | |
import {stateToHTML} from 'draft-js-export-html'; | |
const toolbar = { | |
options: ['inline', 'fontSize','list', 'colorPicker', 'link', 'emoji', 'history'], | |
} |
This file contains 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
-----Then-able Duck Typing------------ | |
Promise dünyasında en önemli şey, bir değişkenin gerçek bir Promise olup,olmadığına | |
karar vermek ya da bir Promise gibi davranış sergileyecek mi onu anlamak. | |
new Promise(...) syntax ı ile verilen Promise lerin, | |
'p instanceof Promise' bu şekilde kontrolünü yapabileceğini düşünebilirsin ama tam | |
oarak bu yaklaşım doğru olmayabilir. | |
Mesela sen başka bir window dan iframe gibi yerlerden Promise alabilirsin. O zaman | |
'p instanceof Promise' kontrolü başarısız olacaktır. |
This file contains 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
React Native Quick Notes | |
----------------------------------------- | |
<View onLayout={this._handleLayout} /> | |
------------------------------------------------------------ | |
onLayout { nativeEvent : { layout: {x, y, width, height} } } | |
-This event is fired immediately once the layout has been calculated | |
-But the new layout may not yet be reflected on the screen at the same time the event is received | |
(Especially if a layout animation is in progress) | |
This file contains 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
Trying to Save Callbacks | |
analytics.trackPurchase(purchaseData,function(){ | |
tracked=true; | |
chargeCreditCard(); | |
displayThankyouPage(); | |
} | |
); |
This file contains 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
'use strict'; | |
import React, { Component } from 'react'; | |
import { StyleSheet,View, Text,TouchableOpacity, | |
TextInput, Platform } from 'react-native'; | |
class Main extends Component { | |
render() { | |
return ( |
This file contains 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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
This file contains 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 liraries | |
import React, { Component } from "react"; | |
import { View, Text, ListView, StyleSheet } from "react-native"; | |
const rows = [ | |
{ id: 1, text: "row1" }, | |
{ id: 2, text: "row2" }, | |
{ id: 3, text: "row3" }, | |
{ id: 4, text: "row4" }, | |
{ id: 5, text: "row5" }, |
This file contains 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 liraries | |
import React, { Component } from "react"; | |
import { View, Text, StyleSheet, ScrollView,LayoutAnimation, StatusBar } from "react-native"; | |
import FlexTab from "./flexTab"; | |
import Header from './header' | |
// create a component | |
class App extends Component { | |
constructor() { | |
super(); | |
this.state = { |
This file contains 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 mobx, { observable } from "mobx"; | |
class Store { | |
@observable todos=[]; | |
@observable selectedStatus="all"; | |
} | |
const todoStore = new Store() | |
export default todoStore; |
This file contains 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 mobx, { observable, action } from "mobx"; | |
class Store { | |
@observable todos=[]; | |
@observable selectedStatus="all"; | |
@action('adding todo item') | |
addTodo(todo){ | |
this.todos.push({ | |
id: this.todos[this.todos.length - 1].id +1, | |
status: false, | |
text: todo |
OlderNewer