Skip to content
Permalink
Browse files

More restructuring. Re-added playground code where appropriate. Moved…

… file store into its own directory (because of chokidar)
  • Loading branch information...
josephg committed Apr 6, 2019
1 parent 83c729e commit ffb14775a5b7075ebc5d25dc9e18235264018b14
@@ -10,3 +10,5 @@ bundle.js
oldlib
oldtest
yarn-error.log
scratch*
*.cluster
@@ -0,0 +1,22 @@

const contentful = async () => {
const keys = JSON.parse(readFileSync('keys.json', 'utf8'))
const ops = createContentful(await kvStore(), {
space: keys.space,
accessToken: keys.contentAPI,

})

const store = await kvStore(undefined, {inner: ops})
const sub = store.subscribe({type: I.QueryType.StaticRange, q: [{
low: sel(''),
// low: sel('post/'),
high: sel('post/\xff'),
}]})
// for await (const r of sub) {
// console.log('results', ins(r))
// }
for await (const r of subValues(I.ResultType.Range, sub)) {
console.log('results', ins(r))
}
}
@@ -17,11 +17,9 @@
"dependencies": {
"@josephg/resolvable": "^1.0.0",
"binary-search": "^1.3.2",
"chokidar": "^2.0.3",
"debug": "^2.2.0",
"es6-error": "^4.1.1",
"ministreamiterator": "^1.0.0",
"ot-text-unicode": "^2.0.1",
"set2": "^1.0.0"
},
"devDependencies": {
@@ -0,0 +1,5 @@
# Statecraft file store

This provides a simple store which watches a JSON file and exposes the file's contents as a store.

All writes replace the entire contents of the file (so its really not efficient), but it works great for managing application configuration.
File renamed without changes.
@@ -0,0 +1,11 @@
{
"name": "@statecraft/filestore",
"version": "0.1.0",
"description": "Statecraft file store",
"main": "index.js",
"author": "Seph Gentle <me@josephg.com>",
"license": "ISC",
"dependencies": {
"chokidar": "^2.1.5"
}
}

0 comments on commit ffb1477

Please sign in to comment.
You can’t perform that action at this time.