-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README.md edited online with Bitbucket
- Loading branch information
Showing
1 changed file
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
# KnockOff # | ||
# Knockoff # | ||
|
||
A simple prototype inspired by [Knockout.js](http://knockoutjs.com) to show how MVVM in Delphi can work. | ||
A simple prototype inspired by [Knockout.js](http://knockoutjs.com) to show how MVVM in Delphi can work. | ||
|
||
### Observable ### | ||
|
||
Core of the library is the Observable<T> type which is an anonymous method type which is overloaded. So it combines being getter and setter in one type. Following code example shows how to get and set the value of an observable. | ||
|
||
|
||
``` | ||
#!delphi | ||
var | ||
o: Observable<Integer>; | ||
i: Integer; | ||
begin | ||
o := Observable.Create(42); | ||
i := o(); // calls the function: T overload | ||
o(i + 1); // calls the procedure(const value: T) overload | ||
``` |