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
(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]) |
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
// ============================================================================= | |
// 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 }); |
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
// ============================================================================= | |
// 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 }); |
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
// ============================================================================= | |
// 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 }); |
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
function isMaxErrors(context, event) { | |
return context.errorCount > 2; | |
} | |
function isVersionMismatch(context, event) { | |
const { currentEditor } = context; | |
const clientEngineVersion = currentEditor && currentEditor.plugins | |
.get('RealTimeCollaborationClient').service._engineVersion; |
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
function maxErrors(context, event) { | |
return context.errorCount > 2; | |
} | |
function versionMismatch(context, event) { | |
const { currentEditor } = context; | |
const clientEngineVersion = currentEditor && currentEditor.plugins | |
.get('RealTimeCollaborationClient').service._engineVersion; |
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
function maxErrors(context, event) { | |
return context.errorCount > 2; | |
} | |
function versionMismatch(context, event) { | |
const { currentEditor } = context; | |
const clientEngineVersion = currentEditor && currentEditor.plugins | |
.get('RealTimeCollaborationClient').service._engineVersion; |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 fetchMachine = Machine({ | |
id: 'fetch', | |
// Initial state | |
initial: 'idle', | |
// States | |
states: { | |
idle: { | |
on: { |
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
(set-env! | |
:dependencies '[[org.clojure/clojure "1.9.0-alpha15"] | |
[org.clojure/test.check "0.9.0"]]) | |
(require | |
'[clojure.spec :as s] | |
'[clojure.spec.test :as stest]) | |
(s/def ::printer fn?) |
NewerOlder