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
// Daily Challenge #107 - Escape the Mines | |
// A poor miner is trapped in a mine and you have to help him to get out! | |
// The mine is completely dark so you have to tell him where to go. | |
// https://dev.to/thepracticaldev/daily-challenge-107-escape-the-mines-2036 | |
// Based on: https://www.redblobgames.com/pathfinding/a-star/introduction.html | |
// by @redblobgames |
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
import React from 'react'; | |
export function createStrictContext(options = {}) { | |
const Context = React.createContext(undefined); | |
Context.displayName = options.name; | |
function useContext() { | |
const context = React.useContext(Context); | |
if (!context) { | |
throw new Error(options.errorMessage || `${name || ''} Context Provider is missing`); | |
} |
OlderNewer