- Create actions similar to Flummox.
- Generate action ids.
- Supports actions with decorators, promises, and therefore ES7 async.
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
(in-ns test | |
(:require | |
[schema.macros :as macros] | |
[schema.utils :as sutils])) | |
;; Wrapper type needed because Entity values do not implement | |
;; IPersistentMap interface | |
(defrecord EntitySchema | |
[schema] | |
Schema |
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
var csp = require('js-csp'), | |
{ chan, putAsync, take, go, put, timeout, spawn} = csp, | |
request = require('superagent'); | |
var urls = ['http://www.google.com', 'http://www.jlongster.com', 'http://www.myntra.com']; | |
go(function*(){ | |
// 1. do a bunch of requests in parallel, and save their response lengths | |
var parallel = yield map(urls, function*(url){ | |
return (yield fetch(url)).text.length; |
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
var data = immstruct({ | |
message: 'Hello, World!' | |
}); | |
// Reference cursors is kind of a compromise and is a result of this: | |
// https://github.com/omniscientjs/omniscient/issues/42 (sorry, alot of text) | |
// One of the problem I have with reference cursors is that | |
// by using "reference cursors" directly in a component, we bind | |
// that component to the specific part of the structure and it hurts |
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 React from 'react'; | |
import component from 'omniscient'; | |
import immstruct from 'immstruct'; | |
import { compose, valueNode, partialProps } from './compose'; | |
const data = immstruct({ counter: 0, title: 'My title' }); | |
const em = component(({partialedTitle, children}) => | |
<em>{partialedTitle}: {children}</em>); |
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
(ns datascript-to-datomic-util | |
(:require [datascript :as d])) | |
;;;; a utility to help with a datomic-datascript roundtrip process involving: | |
;;; 1. export some data from a datomic database and transact into a datascript instance. | |
;;; 2. perform one or more transactions against datascript. | |
;;; 3. transact the sum of all changes made against datascript back into datomic in a single tx | |
;;; this namespace contains two public functions: | |
;;; listen-for-changes: listen to datascript transactions and build up a record of changes |
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
(ns path.to.services.env | |
(:require | |
[clojure.tools.logging :as log] | |
[puppetlabs.trapperkeeper.core :as tk] | |
[puppetlabs.trapperkeeper.services :as s])) | |
(defprotocol EnvironmentConfigService | |
(get-config [this] | |
"Returns a map containing all of the configuration values (enviornmentally aware). Any string value that is | |
prefixed by ENV_, will be considered an environmental variable.") |
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
/* | |
Add `nouns` as http mocks and use in a local db, available via API in develoment | |
* Install the adapter `npm install rethinkdb_adapter --save-dev` | |
* Install RethinkDB, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/install_rethinkdb.sh | |
* Start db `rethinkdb` | |
* Setup Db and Table, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/setup_db.js | |
* Generate a mock `ember g http-mock nouns` and edit your mock to use the db, see code below for 'slides' | |
* Set your application adapter to use `namespace: 'api'` | |
* In our routes use Ember Data in your model hook |