just-paja/redux-entity-routines

View on GitHub
src/Relation.js

Summary

Maintainability
A
0 mins
Test Coverage
import { Configurable } from './Configurable'

export class Relation extends Configurable {
  constructor (config) {
    super('[Relation]', config)
  }

  get connection () {
    return `${this.parent.name}:${this.target.name}`
  }

  get parent () {
    return this.config.parent
  }

  get target () {
    return this.config.target
  }

  get relationName () {
    return `relation(${this.connection})`
  }

  toString () {
    return this.relationName
  }
}