View _.clj
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]) |
View machine.js
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 }); |
View machine.js
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 }); |
View machine.js
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 }); |
View machine.js
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; |
View machine.js
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; |
View machine.js
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; |
View machine.js
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 |
View machine.js
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: { |
View clojure-spec-instrument-hof.clj
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