mathematic-inc / ts-japi

A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification
Apache License 2.0
202 stars 15 forks source link

[FR] Async metaizer #30

Open triqi opened 3 years ago

triqi commented 3 years ago

Is your feature request related to a problem? *

It is useful to be able to perform async operations to produce the output of the metadata.

Describe the solution you'd like*

If the metaizer is an async function, wait for it to resolve.

Describe alternatives you've considered*

  1. Add the meta attributes to the main resource, and while fetching the resource, resolving any meta to include and append it to the resource.
  2. Ensure to exclude the meta attributes from the main resource projection and include it in the metaizer return object.

Additional context

None.

* means required.