Skip to content

v2.0.0-beta.0

Pre-release
Pre-release

Choose a tag to compare

@chharvey chharvey released this 05 Sep 15:02
· 2 commits to master since this release

Breaking

  • introduce new type param to ProcessingFunction{,Async}, which defines the type of content being processed (either Document or DocumentFragment)
  • The ProcessingFunction and ProcessingFunctionAsync types are now context-less function types. This means when sending a function in for your instructions argument, it must not have a this context. The recommended way to enforce this is to use arrow () => {} syntax:
     new Processor<T, U>(template, (frag: DocumentFragment, data: T, opts: U): void => {
     	//...
     })
    This change is breaking if your code uses this inside a function and expects it to be called with a this context.

New Features

  • static .process() and .processAsync() param @frag takes a Document type in addition to DocumentFragment