pinafore/routes/_store/computations/statusComputations.js

15 lines
417 B
JavaScript
Raw Normal View History

2018-03-03 14:15:50 -08:00
import { CHAR_LIMIT } from '../../_static/statuses'
import { measureText } from '../../_utils/measureText'
2018-02-26 22:22:56 -08:00
export function statusComputations (store) {
2018-02-27 21:01:01 -08:00
store.compute('rawComposeTextLength',
['rawComposeText'],
2018-02-27 23:38:33 -08:00
(rawComposeText) => measureText(rawComposeText)
2018-02-26 22:22:56 -08:00
)
2018-02-27 21:01:01 -08:00
store.compute('rawComposeTextOverLimit',
['rawComposeTextLength'],
(rawComposeTextLength) => rawComposeTextLength > CHAR_LIMIT
2018-02-26 22:22:56 -08:00
)
}