canjs / can-connect

Model layer utilities for every JavaScript framework! Assemble real-time, high performance, restful data connections.
https://canjs.com/doc/can-connect.html
MIT License
29 stars 16 forks source link

Replaced fixed order with dynamic ordering #286

Open bmomberger-bitovi opened 7 years ago

bmomberger-bitovi commented 7 years ago

For #271, the automatic addition of data/callbacks when the real-time behavior is used, was a desired feature of can-connect, and necessitated some way for real-time to declare that it needed another package included while still preserving order. this changes the ordering code so individual behaviors can decide where in the order they should go, and allows other connect behavior authors access to this ordering.

justinbmeyer commented 7 years ago

the behaviors shouldn't know about each other, this seems to create that situation?

justinbmeyer commented 7 years ago

The idea behind can-interface is the dependencies should be on the method/property instead of a module.

bmomberger-bitovi commented 7 years ago

What problem is solved by behaviors not knowing about each other?

justinbmeyer commented 7 years ago

Other implementations of those behaviors can be provided.

Sent from my iPhone

On May 3, 2017, at 11:43 PM, Brad Momberger notifications@github.com wrote:

What problem is solved by behaviors not knowing about each other?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bmomberger-bitovi commented 7 years ago

That doesn't change if behaviors reference each other by key as this PR does. Reimplement with same key => order preserved (by the list in existing code; by the inbound deps in this PR); Reimplement with different key => order can be determined by mutating connect.order in existing code, by declaring dependencies in this PR.