cmi5
cmi5 copied to clipboard
refactor: Extract statement construction functions, use `async`/`await`, begin extracting tests.
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.