Skip to content

Instantly share code, notes, and snippets.

View ganny26's full-sized avatar

Selvaganesh ganny26

View GitHub Profile
@ganny26
ganny26 / example.js
Created March 22, 2021 02:20 — forked from millermedeiros/example.js
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
import { useState, useEffect, useCallback } from 'react'
function usePromise(createPromise) {
const [error, setError] = useState()
const [value, setValue] = useState()
useEffect(() => {
let current = true
createPromise().then(