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
Machine({ | |
id: 'Player', | |
initial: 'loading', | |
context: { | |
hasLoaded: false, | |
isSeeking: false, | |
hasPlayed: false, | |
shouldPause: true | |
}, | |
on: { |
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
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent execute "!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" | |
autocmd VimEnter * PlugInstall | source $MYVIMRC | |
endif | |
if (has("termguicolors")) | |
set termguicolors | |
endif | |
call plug#begin('~/.vim/plugged') |
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 |
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
"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
"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
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({ |