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 Map from 'ol/Map'; | |
import View from 'ol/View'; | |
import OSM from 'ol/source/OSM'; | |
import TileLayer from 'ol/layer/Tile'; | |
import {fromLonLat} from 'ol/proj'; | |
import Point from 'ol/geom/Point'; | |
import LineString from 'ol/geom/LineString'; | |
import MultiLineString from 'ol/geom/MultiLineString'; | |
import {Fill, Stroke, Circle, Style} from 'ol/style'; |
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
class Spesification extends Component { | |
state = { | |
value:'' | |
} | |
render(){ | |
const{ data, caption , sendItem, name, initialProp } = this.props | |
const initial=initialProp?initialProp:"Pilih Option" | |
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
export default class PickerModal extends Component { | |
state={ | |
loading:false, | |
option:[], | |
selectedItem:{}, | |
selected:false, | |
modalVisible:false, | |
} | |
loadOptions=()=>{ |
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 { Text, View } from 'react-native'; | |
//api.localTokenKey require | |
class TokenComponent extends Component { | |
state={ | |
tokens:{} | |
} | |
loadAsyncStorage=()=>{ |
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
const testModule=(()=>{ | |
var aLocal='' | |
function setA(a){ | |
aLocal=a | |
} | |
return{ | |
a:function(){return aLocal}, | |
setA | |
} | |
})(testModule) |
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 {View,Text,Picker} from 'react-native'; | |
export default class PickerDemo extends Component { | |
state={ | |
quality:'', | |
size:'' | |
} | |
getValueFromPicker=(val)=>{ |
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
// Memparse array ke bentuk array lain | |
render(){ | |
let bentukSatu=[ | |
{id:'1', nama:'AA',alamat:'alamat1'}, | |
{id:'2', nama:'DD',alamat:'alamat2'}, | |
{id:'3', nama:'CC',alamat:'alamat3'} | |
] | |
let bentukDua=[] // misalnya kita ingin mengubah field object (id, nama, alamat) menjadi field (userId,userNama,userAlamat) | |
let itemBentukDua={} |
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
//Bentuk ke satu pakai map | |
<View> | |
{ | |
[0,1,2,3,4,5,6,7,8,9].map( | |
(item,key)=>(<Text key={key}>{item}</Text>) | |
) | |
} | |
</View> | |
// Bentuk ke dua pakai operator looping for di dalam render |