Skip to content

Instantly share code, notes, and snippets.

View voodooattack's full-sized avatar

Abdullah A. Hassan voodooattack

View GitHub Profile
@voodooattack
voodooattack / README.md
Last active September 24, 2017 21:29
A server-side session API for Vulcan.js.

webtoken-session

A server-side session API for Vulcan.js.

This meteor package provides a session object on the Vulcan.js render context.

The session is stored inside a jsonwebtoken cookie on the client and is automatically saved at the end of each request. (including GraphQL queries)

Particularly useful when used in conjunction with internal-graphql*, which makes GraphQL requests internal to the server process.

@voodooattack
voodooattack / when.md
Last active September 17, 2018 21:25
When: A proposition for a new, event-based programming language based on JavaScript.

when - event-based programming

when is an event-based programming language based on JavaScript, with a few key differences.

when is not fully procedural, and execution can flow non-linearly through the source code.

Program state

A program’s state consists of:

@voodooattack
voodooattack / when-ts.ts
Last active September 18, 2018 05:44
when-ts: first draft
import 'reflect-metadata';
export interface MachineState {
}
/**
* An activation condition, takes two arguments and must return true for the associated action to fire.
*/
export type ActivationCond<State extends MachineState> =
(state: Readonly<State>, machine: EventMachine<State>) => boolean;