Created
June 8, 2016 18:36
-
-
Save niieani/8dcc6ea03d21c76e46d3d21b8c0ea8dc to your computer and use it in GitHub Desktop.
Binding Function interface idea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface BindingFunction { | |
/** | |
* invoked by Aurelia when the binding is bound | |
* updateView is a method that can be used to update the binding | |
* parameters is an array of evaluated parameters passed to the binding at the time of binding | |
*/ | |
subscribe(updateView: (newValue) => void, parameters: Array<any>) | |
/** | |
* invoked by Aurelia when the binding or its parameters changes value | |
* e.g. typing inside: <input value.bind="binding()"> | |
*/ | |
onValue(value: any, parameters: Array<any>) | |
/** | |
* invoked by Aurelia when the binding invoked | |
* e.g. clicking: <button click.trigger="binding()"> | |
*/ | |
onInvocation(event: Event, parameters: Array<any>) | |
/** | |
* invoked by Aurelia when the binding is unbound | |
* used for cleanup of things that were setup during subscribe | |
*/ | |
unsubscribe() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment