This file contains hidden or 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 deriveStatus(){} | |
const stateMachine = Machine( | |
{ | |
id: 'package', | |
initial: 'loading', | |
context: { packageProduct: null, items: {}, price: {}, error: null }, | |
on: { | |
UPDATE_ITEM: { | |
actions: 'updateItems', | |
target: 'validating', |
This file contains hidden or 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
// stores/location.ts | |
import { writable, derived } from "svelte/store"; | |
import { beforeUpdate } from "svelte"; | |
export interface LocationStore { | |
current: Location | undefined; | |
previous: Location | undefined; | |
} |
This file contains hidden or 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
// for when you REALLY need to test the props SomeComponent is rendered with (not recommended) | |
// create a mock that re-implements the default behaviour | |
// but allows us to spy on the props | |
jest.mock('components/SomeComponent', () => { | |
const original = jest.requireActual('components/SomeComponent') | |
return jest.fn(original.default) | |
}) |
OlderNewer