Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 403 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 403 Bytes

Simple realization of computed properties in objects

Special property in object computed wich recalculate its own value only if its dependency(ies) field(s) changed

Example

const computedObject = _withComputed({
    firstName: 'John',
    lastName: 'Doe',

    computed: {
      fullName: (obj) => `${obj.firstName} ${obj.lastName}` // John Doe
    }
  });

License

MIT