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
allIp[i] = {} | |
allIp[i].usable = usableip() | |
allIp[i].ip2v4 = ip2v4() | |
this.state.allPossible.map((possible) => ( | |
<tr> | |
<td>{possible.usable}</td> | |
<td>{possible.ip2v4}</td> |
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 ApolloClient from 'apollo-client'; | |
import { ApolloLink } from 'apollo-link'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { RetryLink } from 'apollo-link-retry'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
const httpLink = new HttpLink({ | |
uri: 'http://localhost:8080/graphql', | |
headers, | |
credentials: 'include', |
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 ApolloClient from 'apollo-client'; | |
import { getOperationAST } from 'graphql'; | |
import { ApolloLink } from 'apollo-link'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { WebSocketLink } from 'apollo-link-ws'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
const httpLink = new HttpLink({ | |
uri: 'http://localhost:8080/graphql', | |
}); |
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 ApolloClient from 'apollo-client'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
const httpLink = new HttpLink({ | |
uri: 'http://localhost:8080/graphql', | |
}); | |
new ApolloClient({ | |
link: httpLink, |
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
onDropdownChange = (e) => { | |
this.setState({ | |
time: e.target.value, // ตาม option value | |
}); | |
} | |
<select | |
onChange={this.onDropdownChange} | |
value={this.state.time} | |
> |
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
var data = [ | |
{ | |
"firstname": "สมยศ", | |
"address": "3", | |
"district": "โชคเหนือ", | |
"amphoe": "ลำดวน", | |
"province": "สุรินทร์" | |
}, | |
{ | |
"firstname": "บุญหนา", |
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
[2017-07-17 20:39:43] develop.ERROR: exception 'ErrorException' with message 'Array to string conversion' in /Users/komcal/Documents/work/mitphon/mitrphol-api/vendor/laravel/framework/src/Illuminate/Database/Grammar.php:39 | |
Stack trace: | |
#0 /Users/komcal/Documents/work/mitphon/mitrphol-api/vendor/laravel/framework/src/Illuminate/Database/Grammar.php(39): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Array to string...', '/Users/komcal/D...', 39, Array) | |
#1 /Users/komcal/Documents/work/mitphon/mitrphol-api/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php(135): Illuminate\Database\Grammar->wrapTable(Array) | |
#2 /Users/komcal/Documents/work/mitphon/mitrphol-api/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php(77): Illuminate\Database\Query\Grammars\Grammar->compileFrom(Object(Illuminate\Database\Query\Builder), Array) | |
#3 /Users/komcal/Documents/work/mitphon/mitrphol-api/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php |
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 { compose, withProps } from recompose | |
class RefsStore { | |
store(name, value) { | |
this[name] = value; | |
} | |
} | |
const enhance = compose( | |
withProps({ refs: new RefsStore() }), | |
) |
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 { compose, withState, withHandlers } from recompose | |
const enhance = compose( | |
withState('count', 'setCounter', 0), | |
withHandlers({ | |
increase: ({ setCounter }) => () => setCounter(n => n + 1), | |
decrease: ({ setCounter }) => () => setCounter(n => n - 1), | |
}) | |
) | |
export default enhance(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
const Component = props => ( | |
<div> | |
Count: {props.count} | |
<button onClick={props.increase}>Increment</button> | |
<button onClick={props.decrease}>Decrement</button> | |
</div> | |
); |