This file contains 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
# Name of the workflow | |
name: Deploy to firebase | |
# Trigger for workflow:- | |
# In this case, trigger this workflow when ever push happens on the master branch only when files | |
# present in web directory got changed | |
on: | |
push: | |
branches: | |
- master | |
paths: |
This file contains 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
function Admin() { | |
function prepareForCouncil() { | |
let servantA = ServantA(); | |
let servantB = ServantB(); | |
let servantC = ServantC(); | |
//Now Admin has power to manage all the servants work with help of Promise.all | |
let overAllStatusPromise = Promise.all([ | |
servantA.cleaningHall(), | |
servantB.arrangeTables(), |
This file contains 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
function ServantA() { | |
//for simplicity hidden the implementation | |
function cleaningHall() { | |
return new Promise(cleaningHallPromiseHandler); | |
} | |
return { | |
cleaningHall: cleaningHall | |
}; | |
} |
This file contains 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
function Servant() { | |
function cleanRoomPromiseHandler(resolve, reject) { | |
//some complex logic goes here and | |
let cleanedRoom = true; | |
if(cleanedRoom) { | |
resolve("I cleaned the room my King"); | |
}else { | |
reject("Sorry my King, I failed to clean room since i slept down ;("); | |
} | |
} |
This file contains 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
function Servant() { | |
function prepareHorsePromiseHandler(resolve, reject) { | |
//some complex logic goes here and | |
let horsesAreReady = true; | |
if(horsesAreReady) { | |
//fulfilling promise | |
resolve("Horses are ready my King :)"); | |
}else { | |
//promise failed | |
reject("Sorry my King, I failed to prepared the horses since horse kicked me so hard ;("); |
This file contains 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
/* ============= util methods ========= */ | |
let cache = null; | |
function getCache(cacheName = "apiCache") { | |
if (!cache) { | |
window.caches.open(cacheName).then(cach => { | |
cache = cach; | |
}); | |
} | |
return cache; | |
} |
This file contains 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, { | |
useEffect, | |
useImperativeHandle, | |
forwardRef, | |
useRef | |
} from "react"; | |
export const Validation = forwardRef(function Validation({ children }, ref) { | |
const validatorRefs = useRef({}); |
This file contains 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 PropTypes from "prop-types"; | |
export class RefreshAtEnd extends React.Component { | |
static propTypes = { | |
root: PropTypes.string.isRequired, // list container | |
onVisible: PropTypes.func // callback to call when loading is visible | |
}; | |
static defaultProps = { |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body{ | |
text-align: center; | |
} | |
.counterSetter{ | |
box-shadow: 0px 2px 25px 0 rgba(17, 17, 24, 0.12); |
NewerOlder