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
const dataUrl = ''; //your data api url | |
(function(dataUrl, Observable) { | |
'use strict'; | |
/******** your impure functions: ***********/ | |
//bind data to the view here |
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
function checkForNewVersions() { | |
if( ! 'BroadcastChannel' in window) return; | |
const assetsUpdates = new BroadcastChannel('precache-updates'); | |
const dataUpdates = new BroadcastChannel('data-updates'); | |
assetsUpdates.addEventListener('message', (event) => { | |
/*alert the user to reload the page to get the new app version*/ | |
}); | |
dataUpdates.addEventListener('message', (event) => { | |
/*alert the user to reload the page to get the new app data*/ | |
}); |
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
Show hidden characters
{ | |
"presets": [ | |
["env", { | |
"targets": { | |
"node": "6.10" | |
} | |
}] | |
] | |
} |
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
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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
import 'package:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
MyAppModel myAppModel = MyAppModel(); | |
myAppModel.addListener(() => runApp(myApp(myAppModel))); | |
myAppModel.updateUI(1); | |
} |
OlderNewer