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 fetchProjections = amount => | |
new Promise((resolve, reject) => { | |
console.log('Fetching ', amount); | |
const projections = {monthlyEstimate: 120, maxAge: 80}; | |
resolve(projections); | |
}); | |
const validateInput = (input, mimimum) => | |
new Promise((resolve, reject) => { | |
if (input >= mimimum) { |
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 fetchProjections = amount => | |
new Promise((resolve, reject) => { | |
console.log('Fetching ', amount); | |
const projections = {monthlyEstimate: 120, maxAge: 80}; | |
resolve(projections); | |
}); | |
const validateInput = (input, mimimum) => | |
new Promise((resolve, reject) => { | |
if (input >= mimimum) { |
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 fetchProjections = amount => | |
new Promise((resolve, reject) => { | |
console.log('Fetching ', amount); | |
const projections = {monthlyEstimate: 120, maxAge: 80}; | |
resolve(projections); | |
}); | |
const validateInput = (input, mimimum) => | |
new Promise((resolve, reject) => { | |
if (input >= mimimum) { |
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 todoMachine = Machine({ | |
id: "todo", | |
initial: "reading", | |
context: { | |
id: undefined, | |
title: "", | |
prevTitle: "" | |
}, | |
on: { | |
TOGGLE_COMPLETE: { |
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 getPot = (ctx) => { | |
if (!ctx.currentPot) { | |
// throw new Error( | |
// 'Attempted to get currentPot from illustration machien context but it was not set', | |
// ); | |
return {}; | |
} | |
return ctx.pots[ctx.currentPot]; | |
}; | |
const updatePot = (obj, e) => assign({ |
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
"use strict"; | |
// const services = { | |
// validateInput: (ctx: IPotContext) => | |
// validateInput(ctx.allocatedAmount, ctx.minimumAmountAllowed), | |
// fetchProjections: (ctx: IPotContext): Pormise<IProjections> => fetchProjections(ctx.allocatedAmount), | |
// }; | |
const getPot = (ctx) => { | |
if (!ctx.currentPot) { | |
throw new Error('Attempted to get currentPot from illustration machien context but it was not set'); | |
} |
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
"use strict"; | |
const defaultContext = { | |
totalSavings: 10000, | |
taxFreeLumpSum: 0, | |
latestPot: '', | |
availableSavings: 0, | |
pots: { | |
flexibleIncomePot: { | |
potName: 'flexibleIncomePot', | |
potType: 'income', |
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
// 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
OlderNewer