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 React from 'react'; | |
import { | |
render, | |
screen, | |
waitForElementToBeRemoved, | |
} from '@testing-library/react'; | |
import { FetchProvider, useFetch } from '../fetch-context'; | |
describe('FetchContext', () => { |
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 React, { createContext, useContext, useEffect, useState } from 'react'; | |
import axios from 'axios'; | |
import PropTypes from 'prop-types'; | |
const FetchContext = createContext(undefined); | |
const { Provider } = FetchContext; | |
const FetchProvider = ({ children }) => { | |
const [csrfToken, setCsrfToken] = useState(null); | |
const [isLoading, setIsLoading] = useState(true); |
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
-----> Node.js app detected | |
-----> Creating runtime environment | |
NPM_CONFIG_LOGLEVEL=error | |
NODE_ENV=production | |
NODE_MODULES_CACHE=true | |
NODE_VERBOSE=false | |
-----> Installing binaries |
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
<?php | |
function returnReferenceArray($array) | |
{ | |
foreach(array_keys($array) as $value) | |
{ | |
$refs[] = &$array[$value]; | |
} | |
return $refs; | |
} |
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
<?php | |
namespace Frend\Brainwork; | |
class AutoLoader | |
{ | |
private $extension = ".php"; | |
public function register() | |
{ | |
spl_autoload_register(array($this,"includeClass")); |