-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support anonymous entities #40
Comments
This is a fantastic idea! Sorry if this is obvious, but what would happen if an anonymous entity tried to refer to a declared entity? Here's a rough example of the question: // data-hash.js
module.exports = hash({
value: 'request:getOrgInfo', // can refer to declared entity?
mapKeys: {
reposUrl: '$repos_url',
eventsUrl: '$events_url'
}
})
// main.js
const dataHash = require('./data-hash')
dataPoint.addEntities({
'request:getOrgInfo': {
url: 'https://api.github.com/orgs/nodejs'
},
'hash:OrgInfo': dataHash // would this pull the value from the declared entity?
}) |
Glad you like the idea! Your example should work out of the gate, because anonymous entities will support all the features that current entities have (and we can already use entities within other entities). |
installs the object-hash library and exports an entityFactories object on datapoint instances ViacomInc#40
love this idea, my only concern is people abusing this feature and creating nested entities which could potentially end up in a crazy triangle of hell mess :) I believe the feature adds a lot of value things to keep in mind:
|
superseded by #129 |
This feature introduces anonymous entities, which are just entities defined without names. Entities that do have names are referred to as declared entities.
API
DataPoint will expose a factory function for each registered entity type:
Example
This example shows the same transform with declared entities and anonymous entities:
declared:
anonymous:
These are main benefits I see from anonymous entities:
Any thoughts?
The text was updated successfully, but these errors were encountered: