Leum gu prìomh susbaint

A’ cleachdadh fo-sgrìobhaidhean

Tha fo-sgrìobhaidhean feumail airson UX fìor-ùine leithid:

  • adhartas luchdachadh suas
  • adhartas obair asyncronach
  • ùrachaidhean beatha sgrìobhainn agus neach-faighinn
  • atharraichean creideis

Airson sgema a’ pheileid fhèin, faic:

Dèan Parstadh air a’ Pheileid Tachartais a-staigh

Tha an raon fo-sgrìobhaidh a’ tilleadh:

  • pasgair lìbhrigidh (userId no groupId)
  • sreang JSON anns an data

Dèan parstadh an-còmhnaidh air luach data a-staigh mus làimhsich thu an tachartas.

const parseEnvelope = (payload) => {
const raw = payload?.data;
if (!raw) return null;
return typeof raw === 'string' ? JSON.parse(raw) : raw;
};

Rèitich le category agus event

Cùm:

  • category mar theaghlach an tachartais
  • event mar an gnìomh sònraichte no staid an obrach-fhluich

Eisimpleirean:

  • category: "upload", event: "uploadCompleted"
  • category: "task", event: "taskCreditBlocked"
  • category: "documentLifecycle", event: "documentCreated"
  • category: "recipientLifecycle", event: "recipientVisiting"

Riaghailtean Lìbhrigidh

  • thathar a’ cleachdadh subscribeUserFeed airson tachartasan air an dùilean don neach-cleachdaidh leithid adhartas luchdachadh suas agus cuid de spreadh beatha.
  • thathar a’ cleachdadh subscribeGroupFeed airson tachartasan air an dùilean air buidheann leithid ùrachaidhean sgrìobhainn, neach-faighinn, teamplaid, obair, creideas, agus beatha.
  • tha cuid de thachartasan air an sgaoileadh gu gach feed leis an aon eventId.

Stiùireadh Co-fhreagarrachd

Ma tha thu a’ gluasad bho na peileadan fo-sgrìobhaidh seann-fhios flat:

  • déan parstadh air an anvelope data a-staigh an toiseach
  • gluais rathadachadh an tachartais gu event an àite an seann systemMessage
  • cleachd category airson co-dhùnadh ciamar a thuigear data
  • lean air adhart a’ dìochuimhneachadh raointean data nach eil aithnichte

Ainmean Tachartais Riochdaireach

Tha ainmean tachartais cumanta a’ toirt a-steach:

  • documentArchived
  • documentCancelled
  • recipientUpdated
  • recipientReset
  • documentCreated
  • documentFinalPdfCreated
  • documentRejected
  • recipientSentEmail
  • recipientVisiting
  • recipientCompleted
  • recipientRejected
  • recipientEmailOpened
  • taskDocumentCreated
  • taskCompleted
  • taskStoppedByRecipientStopList
  • taskTrialCreditBlocked
  • taskCreditBlocked
  • templateArchived
  • templateUpdated
  • templateElementCreated
  • templateElementUpdated
  • templateElementDeleted
  • templateRoleCreated
  • templateRoleUpdated
  • templateRoleDeleted
  • uploadScanned
  • uploadTypeChecked
  • uploadConverting
  • uploadFlattened
  • uploadTagsParsed
  • uploadPdfMetaExtracted
  • uploadCompleted
  • uploadFailed
  • creditUpdated

Stiùiridhean obrach-fhluich sònraichte: