Created
February 4, 2015 20:52
-
-
Save costa/43ddf9ae5c51791aeab6 to your computer and use it in GitHub Desktop.
MockFirebase persistence shim; to be used with e.g. `window.MOCK_FIREBASE = #{{"null/things/#{id}" => firebase_val}.to_json};`
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
| #= require mockfirebase/browser/mockfirebase | |
| MockFirebase.override() | |
| class TrueMockFirebase extends Firebase | |
| constructor: (path)-> | |
| super | |
| _(=> | |
| if window.MOCK_FIREBASE && MOCK_FIREBASE[path] | |
| @set(MOCK_FIREBASE[path]) | |
| MOCK_FIREBASE[path] = null | |
| @flush() | |
| ).delay 999 | |
| window.Firebase = TrueMockFirebase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment