Method

onPublish

onPublish(handler) returns functions.CloudFunction containing non-null functions.pubsub.Message

Event handler that fires every time a Cloud Pub/Sub message is published.

Parameter

handler

function(non-null functions.Event containing non-null functions.pubsub.Message)

Event handler that runs every time a Cloud Pub/Sub message is published.

Value must not be null.

Returns

non-null functions.CloudFunction containing non-null functions.pubsub.Message A Cloud Function which you can export.