Просмотр исходного кода

Don't send stats until nword >= 3

shiny-input
Garrick Aden-Buie 6 лет назад
Родитель
Сommit
9f915337a2
2 измененных файлов: 10 добавлений и 0 удалений
  1. +8
    -0
      inst/shiny-input-app/dev-shiny-input.Rmd
  2. +2
    -0
      inst/shiny-input-app/typing.js

+ 8
- 0
inst/shiny-input-app/dev-shiny-input.Rmd Просмотреть файл

- the current timestamp as `time` and - the current timestamp as `time` and
- the `text` in the input - the `text` in the input


(`r github_sha_link("fa02cb2314fa58ea714002072be0f78da2c6aa82")`)

### Your Turn: Hold your horses

How does the app report the initial typing speed rates?

Add another `if` statement to continue to return `null`
until there are at least 3 words in the text box.

+ 2
- 0
inst/shiny-input-app/typing.js Просмотреть файл

return null return null
} }


if (nword < 3) return null

let time = Date.now() let time = Date.now()
let elapsed = (time - this._timing) / 1000 let elapsed = (time - this._timing) / 1000
return { return {

Загрузка…
Отмена
Сохранить