- Inside store
state: {
count: 0
}| import { Kind } from 'graphql'; | |
| function parseLiteral(value) { | |
| return ast.kind === Kind.BOOLEAN ? ast.value : undefined; | |
| } |
| function parseValue(value) { | |
| if (typeof value !== 'boolean') { | |
| throw new TypeError( | |
| `Boolean cannot represent a non boolean value: ${inspect(value)}`, | |
| ); | |
| } | |
| return value; | |
| } |
| function serializeBoolean(value) { | |
| if (typeof value === 'boolean') { | |
| return value; | |
| } | |
| if (isFinite(value)) { | |
| return value !== 0; | |
| } | |
| throw new TypeError( | |
| `Boolean cannot represent a non boolean value: ${inspect(value)}`, | |
| ); |
| asciidoctor -d book -b docbook5 book.asciidoc -o output.docbook | |
| pandoc -f docbook -t epub out.docbook -o book.epub |
| const success = position => { | |
| const { latitude, longitude } = position.coords; | |
| console.log(`Your coordinates - ${latitude}lat and ${longitude}lng`); | |
| }; | |
| const error = err => { | |
| console.log(err); | |
| }; | |
| getCurrentPosition(success, error); |
| const getLocation = () => new Promise((resolve, reject) => { | |
| const success = position => resolve(position); | |
| const error = error => reject(error); | |
| navigator.geolocation.getCurrentPosition(success, error); | |
| }) | |
| try { | |
| const position = await getLocation(); | |
| console.log(position); |
| # set NODE_ENV | |
| export NODE_ENV=production | |
| # get NODE_ENV | |
| echo $NODE_ENV |
| // to set/create variable use export | |
| export NODE_ENV=development | |
| // to get variable use echo and $ prefix | |
| echo $NODE_ENV | |
| // will return 'development' |