How to use the datx.getModelClassRefs function in datx

To help you get started, we’ve selected a few datx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github infinum / datx / packages / datx-jsonapi / src / decorateModel.ts View on Github external
constructor(rawData: IRawModel|IRecord = { }, collection?: PureCollection) {
      let data = rawData;
      if ((rawData && 'type' in rawData) && ('attributes' in rawData || 'relationships' in rawData)) {
        const classRefs = getModelClassRefs(BaseClass);
        data = flattenModel(classRefs, rawData as IRecord);
      }
      super(data, collection);
    }