Skip to content

Instantly share code, notes, and snippets.

@ashnur

ashnur/app.js Secret

Created March 9, 2017 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashnur/c7d8a6721ce7440a1df42f90dc572120 to your computer and use it in GitHub Desktop.
Save ashnur/c7d8a6721ce7440a1df42f90dc572120 to your computer and use it in GitHub Desktop.
function createIdent(identName){
db = ds.db_with(db, vector(vector(DB_ADD, -1, "DB_IDENT", identName)))
}
const createHistory = require('history').createBrowserHistory
const history = createHistory()
createIdent("history")
//db = ds.db_with(db, vector(vector(DB_ADD, -1, "DB_IDENT", action)))
db = ds.db_with(db, vector( hashMap(DB_ID, vector("DB_IDENT", "history") , "current", toClj(removeNull(history.location)))))
const unlisten = history.listen((location, action) => { // eslint-disable-line no-unused-vars
db = ds.db_with(db, vector( hashMap(DB_ID, vector("DB_IDENT", "history") , "current", toClj(removeNull(location)))))
State.update(db)
})
{
"DB_IDENT": {
":db/unique": ":db.unique/identity"
},
"current": {
":db/valueType": ":db.type/ref",
":db/cardinality": ":db.cardinality/one"
},
"value": {
":db/unique": ":db.unique/identity"
},
"isset": {
":db/cardinality": ":db.cardinality/one"
},
"pathname": {
":db/unique": ":db.unique/identity"
},
"search": {
":db/unique": ":db.unique/identity"
},
"hash": {
":db/unique": ":db.unique/identity"
},
"messages/general": {
":db/cardinality": ":db.cardinality/many",
":db/valueType": ":db.type/ref",
":db/isComponent": true
},
"messages/errors": {
":db/cardinality": ":db.cardinality/many",
":db/valueType": ":db.type/ref",
":db/isComponent": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment