I hereby claim:
- I am mtho11 on github.
- I am mtho11 (https://keybase.io/mtho11) on keybase.
- I have a public key ASDBdBM0_TS0tI-HE6sY0kJntB6AHJ-UvkDVp5YyHRb2pAo
To claim this, I am signing this object:
| import {useState} from 'react'; | |
| const useRequestHandler = () => { | |
| const [isLoading, setLoading] = useState(false); | |
| const [hasError, setError] = useState(false); | |
| const [data, setData] = useState(null); | |
| const handleRequest = (request) => { | |
| setLoading(true); | |
| setError(false); |
| import React, { useState, useEffect } from "react"; | |
| const useFetch = url => { | |
| const [state, setState] = useState({ | |
| loading: true, | |
| error: false, | |
| data: [], | |
| }); | |
| useEffect(() => { |
I hereby claim:
To claim this, I am signing this object:
| const redux = require('redux'); | |
| const createStore = redux.createStore; | |
| const initialState = { | |
| counter: 0 | |
| } | |
| // Reducer | |
| const rootReducer = (state = initialState, action) => { | |
| if (action.type === 'INC_COUNTER') { |
| Curl command used to display raw API data: | |
| curl -s http://swapi.co/api/people/ | |
| Simple jq filter to pretty print JSON response: | |
| curl -s http://swapi.co/api/people/ | jq '.' | |
| Command to display only the results array: |
| // Approach 1: Use React.createClass | |
| var HelloWorld = React.createClass({ | |
| getInitialState() { | |
| return { message: 'Hi' }; | |
| }, | |
| logMessage() { | |
| // this magically works because React.createClass autobinds. | |
| console.log(this.state.message); | |
| }, |
| { | |
| "nodes": [ | |
| { | |
| "data": { | |
| "id": "n3", | |
| "text": "details (v1)", | |
| "service": "details.istio-system.svc.cluster.local", | |
| "version": "v1", | |
| "link_prom_graph": | |
| "http://prometheus:9090/graph?g0.range_input=1h\u0026g0.tab=0\u0026g0.expr=istio_request_count%7Bdestination_service%3D%22details.istio-system.svc.cluster.local%22%2Cdestination_version%3D%22v1%22%7D" |
| [ | |
| { | |
| name: "default" | |
| }, | |
| { name: "development" }, | |
| { name: "fbr-jenkins-slaves" }, | |
| { | |
| name: "hayk-test" | |
| }, | |
| { |
| # unless dependencies.detect { |d| d.name == "manageiq-ui-classic" } | |
| # gem "manageiq-ui-classic", :path => "/Users/mtho11/projects/manageiq-ui-classic" | |
| # end | |
| #override_gem 'manageiq-ui-classic', :path => File.expand_path('plugins/manageiq-ui-classic', __dir__) | |
| override_gem 'manageiq-ui-classic', :path => File.expand_path("../../manageiq-ui-classic", __dir__) | |
| group :development do | |
| gem "pry-byebug" | |
| # gem "web-console", group: :development | |
| end |
| version: '2' | |
| services: | |
| # set up the wildfly with embedded hawkular-agent | |
| hawkfly: | |
| image: "hawkular/wildfly-hawkular-javaagent:latest" | |
| #ports: | |
| # - "8081:8080" | |
| links: | |
| - hawkular |