Setting up Clojure CLI to preload libraries for local dev:
;; ~/.clojure/deps.edn
{:aliases
{:user {:extra-deps {com.gfredericks/user.clj {:mvn/version "0.1.0"}
hashp/hashp {:mvn/version "0.2.2"}}}}}
Setting up Clojure CLI to preload libraries for local dev:
;; ~/.clojure/deps.edn
{:aliases
{:user {:extra-deps {com.gfredericks/user.clj {:mvn/version "0.1.0"}
hashp/hashp {:mvn/version "0.2.2"}}}}}
(ns - | |
(:require [borkdude.dynaload :refer [dynaload]])) | |
(defmacro doc [& args] | |
`(clojure.repl/doc ~@args)) | |
(def t (dynaload 'rads.tap/vals)) | |
(in-ns 'user) | |
(require '[- :refer :all]) |
// ============================================================================= | |
// Updating the Visualization | |
// | |
// The code after this comment can be copy-pasted into the XState Visualizer: | |
// https://xstate.js.org/viz/ | |
// ============================================================================= | |
const incErrorCount = assign({ errorCount: (ctx, event) => ctx.errorCount + 1 }); | |
const incInitCount = assign({ initCount: (ctx, event) => ctx.initCount + 1 }); | |
const incRecoveryCount = assign({ recoveryCount: (ctx, event) => ctx.recoveryCount + 1 }); |
// ============================================================================= | |
// Updating the Visualization | |
// | |
// The code after this comment can be copy-pasted into the XState Visualizer: | |
// https://xstate.js.org/viz/ | |
// ============================================================================= | |
const incErrorCount = assign({ errorCount: (ctx, event) => ctx.errorCount + 1 }); | |
const incInitCount = assign({ initCount: (ctx, event) => ctx.initCount + 1 }); | |
const incRecoveryCount = assign({ recoveryCount: (ctx, event) => ctx.recoveryCount + 1 }); |
// ============================================================================= | |
// Updating the Visualization | |
// | |
// The code after this comment can be copy-pasted into the XState Visualizer: | |
// https://xstate.js.org/viz/ | |
// ============================================================================= | |
const incErrorCount = assign({ errorCount: (ctx, event) => ctx.errorCount + 1 }); | |
const incInitCount = assign({ initCount: (ctx, event) => ctx.initCount + 1 }); | |
const incRecoveryCount = assign({ recoveryCount: (ctx, event) => ctx.recoveryCount + 1 }); |
function isMaxErrors(context, event) { | |
return context.errorCount > 2; | |
} | |
function isVersionMismatch(context, event) { | |
const { currentEditor } = context; | |
const clientEngineVersion = currentEditor && currentEditor.plugins | |
.get('RealTimeCollaborationClient').service._engineVersion; |
function maxErrors(context, event) { | |
return context.errorCount > 2; | |
} | |
function versionMismatch(context, event) { | |
const { currentEditor } = context; | |
const clientEngineVersion = currentEditor && currentEditor.plugins | |
.get('RealTimeCollaborationClient').service._engineVersion; |
function maxErrors(context, event) { | |
return context.errorCount > 2; | |
} | |
function versionMismatch(context, event) { | |
const { currentEditor } = context; | |
const clientEngineVersion = currentEditor && currentEditor.plugins | |
.get('RealTimeCollaborationClient').service._engineVersion; |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
const fetchMachine = Machine({ | |
id: 'fetch', | |
// Initial state | |
initial: 'idle', | |
// States | |
states: { | |
idle: { | |
on: { |