mirror of
https://github.com/nolanlawson/pinafore
synced 2025-01-10 10:16:20 +01:00
15 lines
411 B
JavaScript
15 lines
411 B
JavaScript
import { CHAR_LIMIT } from '../_static/statuses'
|
|
import { measureText } from '../_utils/measureText'
|
|
|
|
export function statusComputations (store) {
|
|
store.compute('rawComposeTextLength',
|
|
['rawComposeText'],
|
|
(rawComposeText) => measureText(rawComposeText)
|
|
)
|
|
|
|
store.compute('rawComposeTextOverLimit',
|
|
['rawComposeTextLength'],
|
|
(rawComposeTextLength) => rawComposeTextLength > CHAR_LIMIT
|
|
)
|
|
}
|