Skip to content

Instantly share code, notes, and snippets.

import { Recipe, Grocery } from "./model";
import { createStandardAction, createAsyncAction } from 'typesafe-actions';
const ADD_RECIPE = '[RECIPE] Add';
const UPDATE_RECIPE = '[Recipe] Update';
const SET_ACTIVE_RECIPE = '[RECIPE] Set Active Recipe';
const UNSET_ACTIVE_RECIPE = '[Recipe] Unset Active Recipe';
const FETCH_RECIPE_REQUEST = '[Recipe] Fetch Recipe Request';
const FETCH_RECIPE_SUCCESS = '[Recipe] Fetch Recipe Sucess';
const FETCH_RECIPE_FAILURE = '[Recipe] Fetch Recipe Failure';
function App({ name }) {
// stateHook that keepts track of the count with initial count = 0
const [count, setCount] = useState(0);
// get the latest count (not the count scoped inside this function)
const latestCount = useRef(count);
// is called for every render and sees the variable states for this particular render
require 'net/http'
require 'json'
while (true)
uri = URI('http://www.outbackbowl.com/')
response = Net::HTTP.get_response(uri) # => String
headers = response.to_hash
cookie_line = headers["set-cookie"].first
cookie = cookie_line.split(';').first