youyesyet.canvasser-app.handlers

Canvasser app event handlers.

add-to-feedback

(add-to-feedback db x)

Add x to the feedback in this db.

add-to-key

(add-to-key db k x)

Return a copy of db with x added to the front of the list of items held against the key k

add-to-outqueue

(add-to-outqueue db message)

Add the supplied message to the output queue in this db.

clear-messages

(clear-messages state)

Return a state like this state except with the error and feedback messages set nil

coerce-to-number

(coerce-to-number v)

TODO: write docs

compose-packet

(compose-packet item)

TODO: write docs

do-update-elector

(do-update-elector db elector)

TODO: write docs

feedback-messages

TODO: write docs

get-elector

(get-elector elector-id state)(get-elector elector-id state address)

Return the elector at this address (or the current address if not specified) with this id.

handle-forbidden

(handle-forbidden response & forms)

If response has status 403 (forbidden) redirect to the login page.

remove-from-feedback

(remove-from-feedback db x)

Remove x from the feedback in this db.

remove-from-key

(remove-from-key db k x)

Remove x from the values of key k in map db.

remove-from-outqueue

(remove-from-outqueue db x)

Remove x from the output queue in this db.

source-host

The base URL of the host from which the app was loaded.