pinafore/routes/_store/computations/statusComputations.js
Nolan Lawson 66801fbc96 refactor
2018-03-03 14:15:50 -08:00

15 lines
417 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
)
}