One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
import { useEffect } from 'react'; | |
function MyComponent({ fetchDrafts, fetchHistory }) { | |
useEffect(() => { | |
if (!fetchDrafts || !fetchHistory) { | |
return null | |
} | |
fetchDrafts(); | |
fetchHistory(); |
const useStateWithPromise = (initialState) => { | |
const [state, setState] = useState(initialState); | |
const resolverRef = useRef(null); | |
useEffect(() => { | |
if (resolverRef.current) { | |
resolverRef.current(state); | |
resolverRef.current = null; | |
} | |
/** |
const users = [ | |
{ name: 'Jim', color: 'blue' }, | |
{ name: 'Sam', color: 'blue' }, | |
{ name: 'Eddie', color: 'green' }, | |
]; | |
const usersByColor = users.reduce((acc, value) => { | |
if (!acc[value.color]) { | |
acc[value.color] = []; | |
} |
const getAddress = async (addresses) => { | |
const existingAddresses = []; | |
const res = addresses.map(async (item) => { | |
const address = await getAddressInfo({ nrg_address: item }); | |
// console.log(address); | |
if (address) { | |
console.log("here"); | |
return existingAddresses.push(address); | |
} | |
}); |
pragma solidity ^0.4.0; | |
pragma experimental ABIEncoderV2; | |
contract MultiSigWallet { | |
uint minApprovers; | |
address beneficiary; | |
address owner; | |
mapping(address => bool) approvedBy; |
pragma solidity ^0.4.0; | |
pragma experimental ABIEncoderV2; | |
contract Voter { | |
struct OptionPos { | |
uint pos; | |
bool exists; | |
} | |
/* eslint-disable camelcase */ | |
/* eslint-disable func-style */ | |
import io from 'socket.io-client'; | |
// we will take callback from external source and use it for what we want her, which is passing true or false | |
export const checkSocketIoConnect = (url, timeout) => { | |
return new Promise(function(resolve, reject) { | |
let errAlready = false; | |
timeout = timeout || 50000; |
def bfs(): | |
q = Queue() | |
q.enqueue([current_room["room_id"]]) | |
visited = set() | |
while q.size() > 0: | |
path = q.dequeue() | |
v = path[-1] | |
if v not in visited: | |
if v == 182: ### change to whatever room you want to find | |
return path |