Skip to content

Instantly share code, notes, and snippets.

View codeBelt's full-sized avatar
💭
I may be slow to respond.

Robert S. codeBelt

💭
I may be slow to respond.
View GitHub Profile
@codeBelt
codeBelt / README.md
Created December 27, 2022 15:16 — forked from tnightingale/README.md
Canada Population
@codeBelt
codeBelt / SagaManager.js
Created August 12, 2017 21:31 — forked from hoschi/SagaManager.js
Hot reloadable redux-saga ... sagas
import mySaga from 'mySaga';
import { take, fork, cancel } from 'redux-saga/effects';
const sagas = [mySaga];
export const CANCEL_SAGAS_HMR = 'CANCEL_SAGAS_HMR';
function createAbortableSaga (saga) {
if (process.env.NODE_ENV === 'development') {
return function* main () {
@codeBelt
codeBelt / library-promise.js
Created March 31, 2017 20:19 — forked from kbravest/library-promise.js
Illustrates loading external JS libraries via promise
/**
* Illustrates loading external JS libraries via promise
*/
class GoogleApiService {
static promise = null;
async getCoolMapStuff() {
const google = await getApi();
<script type="application/javascript">
function loadJS(file) {
// DOM: Create the script element
var jsElm = document.createElement("script");
// set the type attribute
jsElm.type = "application/javascript";
// make the script element load file
jsElm.src = file;
// finally insert the element to the body element in order to load the script
document.body.appendChild(jsElm);
class MyApp {
constructor() {
var myUsers = new CustomCollection<User>();
var myMessages = new CustomCollection<Message>();
myUsers.Add(new User());
myMessages.Add(new Message());
var user: User = myUsers.GetFirst();