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
exports.handler = (event, context) => { | |
console.log('Lambda Function `products-read-all` invoked') | |
return client.query(q.Paginate(q.Match(q.Ref('indexes/all_products')))) | |
.then((response) => { | |
const productRefs = response.data | |
// create new query out of todo refs. | |
// https://docs.fauna.com/fauna/current/api/fql/ | |
const getAllProductDataQuery = productRefs.map((ref) => { | |
return q.Get(ref) |
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
[build] | |
functions = "functions" | |
# This will be run the site build | |
command = "npm run build" | |
# This is the directory is publishing to netlify's CDN | |
publish = "build" | |
[dev] | |
# Local dev command. A.k.a npm start | |
command = "react-scripts start" |
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
exports.handler = (event, context, callback) => { | |
// "event" has information about the path, body, headers, etc. of the request | |
console.log('event', event) | |
// "context" has information about the lambda environment and user details | |
console.log('context', context) | |
// The "callback" ends the execution of the function and returns a response back to the caller | |
return callback(null, { | |
statusCode: 200, | |
body: JSON.stringify({ | |
data: 'hello world' |
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
/* bootstrap database in your FaunaDB account */ | |
const readline = require('readline') | |
const faunadb = require('faunadb') | |
const chalk = require('chalk') | |
const insideNetlify = insideNetlifyBuildContext() | |
const q = faunadb.query | |
console.log(chalk.cyan('Creating your FaunaDB Database...\n')) | |
// 1. Check for required enviroment variables |
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 { define } from 'hybrids'; | |
const MyElement = { | |
count: 0, | |
render: ({ count }) => {...}, | |
}; | |
define('my-element', MyElement); |
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 { html, define } from 'hybrids'; | |
export function increaseCount(host) { | |
host.count += 1; | |
} | |
export const SimpleCounter = { | |
count: 0, | |
render: ({ count }) => html` | |
<button onclick="${increaseCount}"> |
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
axe.run(function (err, results) { | |
if (err) throw err; | |
ok(results.violations.length === 0, 'Should be no accessibility issues'); | |
// complete the async call | |
... | |
}); |
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
const React = require('react'); | |
const ReactDOM = require('react-dom'); | |
if (process.env.NODE_ENV !== 'production') { | |
const axe = require('react-axe'); | |
axe(React, ReactDOM, 1000); | |
} |
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
AOS.init(); | |
// You can also pass an optional settings object | |
// below listed default settings | |
AOS.init({ | |
// Global settings: | |
disable: false, // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function | |
startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on | |
initClassName: 'aos-init', // class applied after initialization | |
animatedClassName: 'aos-animate', // class applied on animation |
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 { createSelector } from "reselect"; | |
const selectAllPets = state => state.pets.data; | |
export const selectAllDogs = createSelector( | |
selectAllPets, | |
allPets => allPets | |
); |