Gift | Your ex-roommate | The townsfolk |
---|---|---|
Beer | ✓ | |
Homecooked meals | ✓ | ✓ |
Grass | ||
"Grass" | ✓ | |
Rare crystals | ✓ | |
"Rare crystals" | ✓ |
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 { rxSandbox } from 'rx-sandbox'; | |
import { tallyWorkspaceUsageEpic } from '../epics/tally-workspace-usage'; | |
describe('tallyWorkspaceUsageEpic', () => { | |
it('should accumulate time until the app is quit', () => { | |
const { hot, flush, getMessages, e } = rxSandbox.create(); | |
const w = { type: WORKSPACE.SELECTION_CHANGED, payload: 'Hiro' }; | |
const x = { type: WORKSPACE.SELECTION_CHANGED, payload: 'Fiona' }; |
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
/** | |
* Keep a running total of time spent on each workspace and, once the app is quit, | |
* fire an action that updates the usage property in the store. | |
*/ | |
const tallyWorkspaceUsageEpic = (action$, store, scheduler) => { | |
return selectionChangedObservable(action$, store) | |
.timeInterval(scheduler) | |
.pairwise() | |
.reduce(usagePayloadFromIntervals, {}) | |
.map((payload) => ({ |
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 { webContents as WebContents } from 'electron'; | |
import { NOTIFICATIONS } from '../constants/actions'; | |
import { | |
notificationClickCode, | |
notificationReplyCode | |
} from '../constants/code'; | |
/** | |
* An epic that executes some code in the guest page when the user clicks or | |
* replies to a native notification. |
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 { BrowserWindow } from 'electron'; | |
import { REHYDRATE } from 'redux-persist/constants'; | |
import { getWorkspacesCount } from '../reducers/workspaces'; | |
const signInWindowEpic = (action$, store) => { | |
// Rehydrate is just a $10 word for "we loaded saved state from a file" | |
// Since we're a redux-persist app, it's one of the first actions that occurs | |
return action$.ofType(REHYDRATE) | |
.filter(() => getWorkspacesCount(store) > 0) | |
.map(() => createSignInWindow(store)) |
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
let timeExpired = rx.Observable.timer(0, 1000, scheduler) | |
.take(timeout + 1) | |
.publishLast(); | |
let newPlayers = messages.where(e => e.text && e.text.toLowerCase().match(/\byes\b/)) | |
.map(e => e.user) | |
.distinct() | |
.take(maxPlayers) | |
.publish(); |
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
doABettingRound(players) { | |
for (let player of players) { | |
tellThatPlayerToAct(player); | |
startATimer(timerCallback); | |
seeIfTheySentAMessage(messageCallback); | |
} | |
} | |
... |
I hereby claim:
- I am CharlieHess on github.
- I am chess (https://keybase.io/chess) on keybase.
- I have a public key whose fingerprint is BAB8 B831 7A5E 18E9 9460 BE8B 7CD2 4F2D 402C C81A
To claim this, I am signing this object:
NewerOlder