ember-source
Version:
A JavaScript framework for creating ambitious web applications
21 lines (17 loc) • 568 B
JavaScript
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
const OWNER = Symbol("OWNER");
/**
Framework objects in a Glimmer application may receive an owner object.
Glimmer is unopinionated about this owner, but will forward it through its
internal resolution system, and through its managers if it is provided.
*/
function getOwner(object) {
return object[OWNER];
}
/**
`setOwner` set's an object's owner
*/
function setOwner(object, owner) {
object[OWNER] = owner;
}
export { OWNER, getOwner, setOwner };