Skip to content

Instantly share code, notes, and snippets.

View dankremniov's full-sized avatar

Daniel Kremniov dankremniov

View GitHub Profile
@dankremniov
dankremniov / machine.js
Last active October 21, 2021 14:14
Generated by XState Viz: https://xstate.js.org/viz
const fanMachine = Machine({
id: "fan",
initial: "uploadCashFlows",
context: {
cashFlow: null,
previousCashFlowId: null
},
states: {
@dankremniov
dankremniov / machine.js
Created October 21, 2021 12:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@dankremniov
dankremniov / README.md
Created February 16, 2021 14:45
Access window object within cy.intercept

We can use cy.state('window') to get window object synchronously. The command can also be used to store arbitrary state (example).

E.g. within cy.intercept:

cy.intercept('GET', '/test', (req) => {
    const win = cy.state('window');

    // do something with the window
})
@dankremniov
dankremniov / Chart.tsx
Last active February 21, 2024 06:41
Render React component for Highcharts tooltip
import React, { useState, useCallback } from "react";
import Highcharts, { Chart as HighchartsChart } from "highcharts";
import HighchartsReact from "highcharts-react-official";
import { Tooltip } from "./Tooltip";
const options = {
title: {
text: "Custom tooltip as React component"
},
series: [