Created
June 4, 2018 11:37
-
-
Save peted70/88417293fb30eeb78d5bcc6e7f4200e6 to your computer and use it in GitHub Desktop.
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
// I can declare a variable like this | |
subject<SceneManager const&> SceneChanged; | |
// subscribe for changes using an arbitrary function signature | |
sub_token RegisterForUpdates(function<void(SceneManager const&)> slot) | |
{ | |
return SceneChanged.subscribe(slot); | |
} | |
// Then when changes happen, notify observers like this.. | |
SceneChanged.notify(*this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment