-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new emitTypingIndicator action (#2413)
* Add new emitTypingIndicator action * Update PR number and rename files * Remove commented out code * Update entry
- Loading branch information
Showing
8 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const EMIT_TYPING_INDICATOR = 'WEB_CHAT/EMIT_TYPING_INDICATOR'; | ||
|
||
export default function emitTypingIndicator() { | ||
return { | ||
type: EMIT_TYPING_INDICATOR | ||
}; | ||
} | ||
|
||
export { EMIT_TYPING_INDICATOR }; |
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
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
21 changes: 21 additions & 0 deletions
21
packages/core/src/sagas/emitTypingIndicatorToPostActivitySaga.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { put, takeEvery } from 'redux-saga/effects'; | ||
|
||
import { EMIT_TYPING_INDICATOR } from '../actions/emitTypingIndicator'; | ||
import postActivity from '../actions/postActivity'; | ||
import whileConnected from './effects/whileConnected'; | ||
|
||
function* postTypingActivity() { | ||
yield put( | ||
postActivity({ | ||
type: 'typing' | ||
}) | ||
); | ||
} | ||
|
||
function* emitTypingActivityToPostActivity() { | ||
yield takeEvery(({ type }) => type === EMIT_TYPING_INDICATOR, postTypingActivity); | ||
} | ||
|
||
export default function* emitTypingActivityToPostActivitySaga() { | ||
yield whileConnected(emitTypingActivityToPostActivity); | ||
} |
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