whitetigle / elpouch Goto Github PK
View Code? Open in Web Editor NEWUse PouchDB with Fable!
License: MIT License
Use PouchDB with Fable!
License: MIT License
Currently I'm working with pouchdb-authentication on several projects. It's a neat way to use couchdb authentication support right from the app and also a good way to prototype and test a project fast without having to set any web server.
Last but not least it allows to use the great one-db-per-user model which mean we can check user authorizations (user/role) for any db from the couchdb side.
So my question is simple: is it interesting to add support for authentication too from ElPouch through wrappers and helpers?
All is said.
I tried several methods, but none work. It seems I have some problem with my build file and there's also some bug with older .nuspec files in obj that lead to a fail.
So I need to investigate that.
After adding the dependency of ElPouch to my Fable project I get this error:
ERROR in ./src/IccpdPlusModel.fsproj
Module build failed (from ./node_modules/fable-loader/index.js):
Error: File does not exist:
<some path>/.fable/ElPouch.0.0.6/ElPouch/Encoder.fs
at Loader.fableUtils.client.send.then.r (<some path>\node_modules\fable-loader\index.js:67:22)
@ multi (webpack)-dev-server/client?http://localhost:8080 (webpack)/hot/dev-server.js @babel/polyfill ./src/IccpdPlusModel.fsproj app[3]
When I add the missing file manualy from the ElPouch repo the build succeeds.
No idea how to start, but still an idea.
(thought this after seing https://twitter.com/isaac_abraham/status/1069262531561209857)
When I try to evaluate the results of bulkDocs
I get a Fable compiler error. I want to check the results of bulkDocs.
Sample code (I enhanced the existing test code in CoreTests.fs with the last 5 lines of code):
let data =
[0..100]
|> List.map(Test.Dummy >> Test.Encode)
|> List.toArray
let options: PouchDB.Core.BulkDocsOptions = jsOptions(fun opt ->
opt.docs <- !!data
)
let! results = db.bulkDocs options
results
|> Seq.iter (fun result ->
match result with
| U2.Case1 response -> printfn "--- result: %A" result
| U2.Case2 error -> printfn "--- error: %A" error)
You can get the full code at my fork of this repo .
Compiler error:
error FABLE: Cannot type test: interface "PouchDB.Core.PouchDB.Core.Error"
Am I doing wrong or is this perhaps a bug related to (dev2.0) Cannot type test any exception .
I attempted to solve the problem according to .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.