Only code I want to execute should execute.
Anything in either a fenced block or indented by 4 spaces/tab blindly executes.
import React from "react"; | |
// ex. API.get(path: string, opts:any = {}):Promise | |
import API from "./rest-api"; | |
export class MissingPathError extends Error { | |
message = "Missing path argument."; | |
} | |
export class MissingBodyError extends Error { | |
message = |
/** | |
* Simple deep equal function. Note that this expects a JSON-like config object; | |
* it is not designed for anything more complex. | |
* | |
* @param {any} a | |
* @param {any} b | |
* @returns {boolean} | |
*/ | |
export function deepEqual(a, b) { | |
if (Object.is(a, b)) { |
function* coords(width, height) { | |
while (true) { | |
yield [Math.floor(Math.random() * width), Math.floor(Math.random() * height)]; | |
} | |
} | |
function* take (n, iterable) { | |
for (const item of iterable) { | |
if (n <= 0) return; | |
n--; |
const TheoUserSecurityPreference = { | |
PIN: "PIN", | |
BIOMETRIC: "BIOMETRIC", | |
NONE: "NONE" | |
} | |
// export const bootMachine = Machine<BootMachineContext, BootMachineEvent, BootMachineSchema>({ | |
const bootMachine = Machine<({ | |
id: "boot", | |
initial: "fetchingAssets", |
const TheoUserSecurityPreference = { | |
PIN: "PIN", | |
BIOMETRIC: "BIOMETRIC", | |
NONE: "NONE" | |
}; | |
// services | |
async function cacheStaticImages() { | |
console.log("Images cached") | |
return; |
import React from "react"; | |
import { StyleSheet, Text, TextInput, View } from "react-native"; | |
/* --------------------------------------- *\ | |
* Local versions of imported modules, | |
* just for isolated testing. | |
\* --------------------------------------- */ | |
const s = StyleSheet.create({ | |
white: { color: "#ffffff" }, | |
bg_mid: { backgroundColor: "#1A5163" }, |
const authMachine = Machine({ | |
id: 'auth', | |
initial: 'idle', | |
context: { | |
error: null, | |
isAuthorised: false, | |
retries: 3, | |
}, | |
states: { | |
idle: { |
defmodule Collection.Artist do | |
use Ecto.Schema | |
schema "artists" do | |
field(:name, :string) | |
end | |
def changeset(struct, params) do | |
struct | |
|> Ecto.Changeset.cast(params, [:name]) |
const timermachine = Machine({ | |
id: "timer", | |
initial: "inactive", | |
context: { | |
breakLength: 10, | |
breakRemaining: 0, | |
sessionLength: 10, | |
sessionRemaining: 0, | |
cooldownLength: 1, | |
cooldownRemaining: 0, |