cmi5 icon indicating copy to clipboard operation
cmi5 copied to clipboard

refactor: Extract statement construction functions, use `async`/`await`, begin extracting tests.

Open emmanuel opened this issue 6 months ago • 11 comments

Main thing here is extracting statement construction from other logic.

First goal is to support simpler and more extensive testing of statement construction (see cmi5-statements.spec.ts), but secondarily it opens up the library to additional (unforeseen) use-cases by providing CMI5-compliant xAPI statement construction ala carte from the LRS client. If you're into patterns, this PR could be described as an application of the "single responsibility principle" pattern (statement construction vs LRS communication).

Stylistically, this de-emphasizes classes and focuses on functions and data types.

emmanuel avatar Aug 23 '24 18:08 emmanuel