Skip to content

Instantly share code, notes, and snippets.

@steprobe
steprobe / vimspector-mocha.json
Last active January 6, 2024 14:24
Vimspector + mocha
...
"configuration": {
"request": "launch",
"name": "Debug mocha Test",
"type": "node",
"program": "${workspaceRoot}/node_modules/mocha/bin/mocha",
"env": {
"NODE_ENV": "test"
},
"args": [
@steprobe
steprobe / MentionsRepository.kt
Created March 19, 2021 14:23
Observable Repo pattern using shared flow
@ExperimentalCoroutinesApi
@FlowPreview
class MentionsRepository(
private val middleEnd: MiddleEnd,
private val mentionsDao: MentionDao,
private val mapper: MentionsMapper
) {
private val _mentions = MutableSharedFlow<DataState<List<MentionDisplayModel>>>()
val mentions = _mentions.asSharedFlow()
@steprobe
steprobe / MentionsRepository.kt
Created March 19, 2021 12:07
Observable Repo pattern using BroadcastChannel
@ExperimentalCoroutinesApi
@FlowPreview
class MentionsRepository(
private val middleEnd: MiddleEnd,
private val mentionsDao: MentionDao,
private val mapper: MentionsMapper
) {
private val mentionsBroadcastChannel = BroadcastChannel<DataState<List<MentionDisplayModel>>>(Channel.BUFFERED)