From 636d5394acaab75fb08294f1c874753f46986c8c Mon Sep 17 00:00:00 2001 From: Uldis Zeidurs Date: Wed, 31 Jan 2018 15:39:49 +0200 Subject: [PATCH] fixed it so that it compiles and can be used in JS without instantiating in UX --- README.md | 5 ----- SQLite.uno | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ea49268..8d1b3b1 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,6 @@ Using [fusepm](https://github.com/bolav/fusepm) ## Usage: -### UX - -`` - - ### JS ``` diff --git a/SQLite.uno b/SQLite.uno index 49cb470..71a2b02 100644 --- a/SQLite.uno +++ b/SQLite.uno @@ -1,3 +1,5 @@ +using Uno; +using Uno.UX; using Fuse; using Fuse.Scripting; using Fuse.Reactive; @@ -6,10 +8,16 @@ using Bolav.ForeignHelpers; // Version: 0.03 // https://github.com/bolav/fuse-sqlite +[UXGlobalModule] public class SQLite : NativeModule { + static readonly SQLite _instance; + public SQLite() { + if (_instance != null) return; + Uno.UX.Resource.SetGlobalKey(_instance = this, "SQLite"); + AddMember(new NativeFunction("open", (NativeCallback)Open)); AddMember(new NativeFunction("openFromBundle", (NativeCallback)OpenFromBundle)); }