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
var dist = require('euclidean-distance'); | |
var _ = require('lodash'); | |
var nodes =[ | |
{ id: 0, | |
breed: 'Pitbull', | |
genes: { | |
big: 7, | |
likesWater: 3, | |
shortHair: 10, |
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
var dist = require('euclidean-distance'); | |
var _ = require('lodash'); | |
var nodes =[ | |
{ id: 0, | |
breed: 'Pitbull', | |
genes: { | |
big: 7, | |
likesWater: 3, | |
shortHair: 10, |
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
const TCUserQuery = useCallback(() => { | |
return Object.keys(defaultTCs).map((tc) => | |
rtdb.ref(`users/${tc}`).once('value'), | |
); | |
}, [defaultTCs, rtdb]); | |
useEffect(() => { | |
async function getTCContacts() { | |
const transactionCoordinatorsResponse = await Promise.all([TCUserQuery()]); |
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
const whatMachine = Machine({ | |
id: 'whatDoIDo?', | |
initial: 'loading', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
loading: { | |
on: { | |
SUCCESS: "loaded", |
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 { Machine, mapState, matchesState } from "xstate"; | |
import cx from "classnames"; | |
import nested from "nested-property"; | |
import objectToNotation from "object-to-dot-notation"; | |
export default class Lights extends React.PureComponent { | |
constructor(props) { | |
super(props); |