Skip to content

Instantly share code, notes, and snippets.

View ChettaDarkkill's full-sized avatar

Chetta Crobkatoke ChettaDarkkill

  • True Corporation Public Company Limited
View GitHub Profile
version: '3'
services:
jenkins:
image: jenkins/jenkins:latest
restart: always
ports:
- 1112:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
const OtherComponent = React.lazy(() => import('./OtherComponent'));
function MyComponent() {
return (
<div>
<Suspense fallback={<div>Loading...</div>}>
<OtherComponent />
</Suspense>
</div>
);
const OtherComponent = React.lazy(() => import('./OtherComponent'));
function MyComponent() {
return (
<div>
<OtherComponent />
</div>
);
}
import OtherComponent from './OtherComponent';
function MyComponent() {
return (
<div>
<OtherComponent />
</div>
);
}
async testFeed() {
const token = await AsyncStorage.getItem("token")
axios.get('http://demo.com/api/v1/feed',
{ headers: { 'x-access-token': token } })
.then(response => {
const result = response.data.result
console.log(result)
})
.catch(error => {
console.log(error);
import {httpClient} from './HttpClient'
....
httpClient
.get('/feed')
.then(result=>{
Alert.alert(JSON.stringify(result.data))
})
import React, { Component } from 'react';
import { AsyncStorage } from 'react-native';
import axios from 'axios'
import join from 'url-join'
axios.interceptors.request.use(async (config)=> {
const jwtToken = await AsyncStorage.getItem("token")
if (jwtToken != null) {
import React, { Component } from 'react'
class InputData extends Component {
render() {
return(
<div className="panel-footer">
<div className="input-group">
<input id="btn-input" type="text" className="form-control input-sm" placeholder="Type your message here..." />
<span className="input-group-btn">