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
function isDifferentFlight(flight1, flight2) { | |
let valid = | |
(!flight1 && flight2) || | |
( | |
flight1 && flight2 && | |
( | |
flight1.state !== flight2.state || | |
flight1.flightNumber !== flight2.flightNumber || | |
flight1.takeoffDateTime !== flight2.takeoffDateTime || | |
flight1.originIATA !== flight2.originIATA || |
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 pedestrianStates = { | |
initial: 'walk', | |
states: { | |
walk: { | |
on: { | |
PED_COUNTDOWN: 'wait' | |
} | |
}, | |
wait: { | |
on: { |
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 parentMachine = Machine({ | |
id: 'your_id_here', | |
initial: 'pending', | |
states: { | |
pending: { | |
on: { CHANGE_EVENT: 'process' } | |
}, | |
process: { | |
type: 'parallel', | |
states: { |
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 isUndefined = (x) => typeof x === 'undefined'; | |
const flightOpen = ({ flight }) => !isUndefined(flight); | |
const flightClosed = ({ flight }) => !!isUndefined(flight); | |
const flight = undefined; | |
const fetchMachine = Machine({ | |
id: 'flight', | |
context: { flight, error: undefined }, |
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 Ember from 'ember'; | |
const { computed: { alias }, observer } = Ember | |
export default Ember.Component.extend({ | |
params: Ember.inject.service('task-pager') | |
}) |
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 Ember from 'ember'; | |
const { computed: { alias }, observer } = Ember | |
export default Ember.Component.extend({ | |
routing: Ember.inject.service('-routing'), | |
params: alias('routing.router.currentState.routerJsState.fullQueryParams') | |
}) |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
}) |
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 Ember from 'ember'; | |
export default Ember.Checkbox.extend({ | |
}); |
NewerOlder