@roomservice/browser
Advanced tools
Comparing version 0.4.0-4 to 0.4.0-5
@@ -78,2 +78,7 @@ "use strict"; | ||
const room = client.room("my-room"); | ||
// @ts-ignore because trust me typescript, I am very wise and have | ||
// been on this earth longer than thee, and I, the great programmer, | ||
// know for certain that window.indexDB is, in fact, equal to | ||
// wiggly-woggle-pop. | ||
window.indexedDB = "wiggly-woggle-pop"; | ||
jest.spyOn(offline_1.default, "getDoc").mockImplementation(async (ref, doc) => { | ||
@@ -80,0 +85,0 @@ return automerge_1.save(automerge_1.from({ name: "offlinedoc" })); |
import { Obj, Room, Session } from "./types"; | ||
/** | ||
* // Init | ||
* if (onServer) { | ||
* if (!ctx) throw new Error(); | ||
* | ||
* const { doc } = authorize(url, ctx) | ||
* return { doc } | ||
* } | ||
* | ||
* // setDoc and onSetDoc are noops on the server. | ||
* | ||
* | ||
*/ | ||
export default class DocClient<T extends Obj> { | ||
@@ -16,0 +3,0 @@ private readonly _peer; |
@@ -16,15 +16,2 @@ "use strict"; | ||
} | ||
/** | ||
* // Init | ||
* if (onServer) { | ||
* if (!ctx) throw new Error(); | ||
* | ||
* const { doc } = authorize(url, ctx) | ||
* return { doc } | ||
* } | ||
* | ||
* // setDoc and onSetDoc are noops on the server. | ||
* | ||
* | ||
*/ | ||
class DocClient { | ||
@@ -87,4 +74,5 @@ constructor(parameters) { | ||
async restore() { | ||
// We can't restore on the server. | ||
if (typeof window === "undefined") { | ||
// We can't restore on the server, or in environments | ||
// where indexedb is not defined | ||
if (typeof window === "undefined" || typeof indexedDB === "undefined") { | ||
return {}; | ||
@@ -91,0 +79,0 @@ } |
{ | ||
"name": "@roomservice/browser", | ||
"version": "0.4.0-4", | ||
"version": "0.4.0-5", | ||
"main": "dist/index", | ||
@@ -5,0 +5,0 @@ "types": "dist/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63300
985