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
const SERVICE_ORDER_FETCHER = "orderFetcher"; | |
const STATE_COMPLETED = "completed"; | |
const STATE_FAILED = "failed"; | |
const FETCH_INTERVAL = 500; | |
const MAX_FETCH_COUNT = 3; | |
const ERROR_ORDER_CODE_IS_UNDEFINED = new Error("orderCode is undefined"); | |
const ERROR_FETCH_TIMES_OVER_LIMITS = new Error( |
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
const SERVICE_ORDER_FETCHER = "orderFetcher"; | |
const STATE_COMPLETED = "completed"; | |
const STATE_FAILED = "failed"; | |
const FETCH_INTERVAL = 1000; | |
const MAX_FETCH_COUNT = 60; | |
const ERROR_ORDER_CODE_IS_UNDEFINED = new Error("orderCode is undefined"); | |
const ERROR_FETCH_TIMES_OVER_LIMITS = new Error( |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
const SERVICE_CONFIRM_ORDER_FETCHER = "confirmOrderFetcher"; | |
const ACTION_ON_ORDER_CONFIRMED = "onOrderConfirmed"; | |
const STATE_SUBMITTING = "submitting"; | |
// https://xstate.js.org/viz/?gist=886857c070d6f5a20bc1fd638e99192c | |
const confirmationMachine = Machine({ | |
id: "confirmation", | |
initial: "editing", | |
context: {}, | |
states: { |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
const submitMachine = Machine( | |
{ | |
initial: "idle", | |
context: { | |
orderCode: "some" | |
}, | |
states: { | |
idle: { | |
on: { | |
SUBMIT: [ |
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
App& | |
Content | |
Stores | |
pick store -> Categories | |
Categories | |
pick category -> Product List | |
back to store list -> Stores | |
Product List | |
choose product -> Product | |
back to categories -> Categories |
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
/** | |
* Translucent borders | |
*/ | |
body { | |
background: url('http://csssecrets.io/images/stone-art.jpg'); | |
} | |
div { | |
border: 10px solid hsla(0,0%,100%,.5); |
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
#root |
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
package main | |
import ( | |
"fmt" | |
"github.com/jinzhu/gorm" | |
_ "github.com/lib/pq" | |
) | |
var DB *gorm.DB |
NewerOlder