canjs / can-reflect

Operate on unknown data types
https://canjs.com/doc/can-reflect.html
MIT License
4 stars 4 forks source link

Add methods for setting/getting order in which computes should be updated #11

Open phillipskevin opened 7 years ago

phillipskevin commented 7 years ago

The code from here should be abstracted into a canReflect API:

if(observable instanceof Observation) {
    observable.compute._primaryDepth = nodeList.nesting;
} else if(observable.computeInstance) {
    observable.computeInstance.setPrimaryDepth(nodeList.nesting);
} else if(observable.observation) {
    observable.observation.compute._primaryDepth = nodeList.nesting;
}

Maybe this should be called priority or orderNumber.

justinbmeyer commented 7 years ago

I like setPriority which will be a number from 0->Infinity where 0 is the highest priority.