Skip to content

Instantly share code, notes, and snippets.

View hereisfun's full-sized avatar

calvinfung hereisfun

View GitHub Profile
@hereisfun
hereisfun / pubSub.js
Created March 7, 2017 13:54
简单的pub/sub模式实现
var pubSub = (function(){
//以各种event为键,值为该event绑定的callback队列
var eventQueues = {};
//此处只发布event本身,不携带其它信息。
//可稍作修改增加参数实现携带信息。
function pub(event){
if(!eventQueues[event]){
//若发布event时没有该event对应的callback队列
eventQueues[event] = [];
@hereisfun
hereisfun / index.html
Created October 12, 2020 03:02
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<input type="file" />