Forgive the sloppy code and structure, I just needed some scaffolding to explain the issue at hand. Assume RequireJS is used for modules.
The way this is implemented now, mixin
will have it's internal variables set to 'privateStuff' rather than 'private', so when the user navigates to the single
action, it won't alert private
.
This is because of how the items are retrieved in the order they are specified and because the closure scope in the mixin is shared between all instances that use it, but preserve essentially the last variable that it was called with.
The problem can be mitigated if the mixins are mixed on initialize
of the models or if the exports
of mixin
curries the methods which use the private properties, so that the variable is bound to the specified option.