How to use the gun/gun function in gun

To help you get started, we’ve selected a few gun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SocialXNetwork / socialx_react_native / packages / api-data / src / __testHelpers / mockApi.ts View on Github external
export const dataApiFactory = (accountMock: IAccountMock) => {
	const time = () => new Date(Gun.state());

	const rootGun: IGunInstance = new Gun({
		localStorage: false,
		radix: true,
	});

	const gun = rootGun.get('test');

	// const account = gun.user();
	const account: IGunAccountInstance = {
		create(
			username: string,
			password: string,
			callback?: (data: { wait?: boolean; err?: string; ok?: number; pub: string }) => void,
		) {
			return this;
		},
		auth(
github SocialXNetwork / socialx_react_native / packages / api-data / src / api.ts View on Github external
export const dataApiFactory = (config: IApiOptions) => {
	const { peers, rootdb } = config;

	const time = () => new Date(Gun.state());

	const rootGun: IGunInstance = new Gun({
		peers,
	});

	const gun = rootGun.get(rootdb);

	let account = rootGun.user();

	const { encrypt, decrypt, work } = Gun.SEA;

	// testing purposes
	// @ts-ignore
	window.gun = gun;
	// @ts-ignore
	window.user = account;
	
	const context: IContext = {
github amark / gun / examples / angular / src / app / gun.service.ts View on Github external
import { NgModule, Injectable } from '@angular/core';
import Gun from 'gun/gun';

@Injectable()
export class GunDb {
    readonly gun = Gun(location.origin + '/gun');
}
github sjones6 / gun-flint / bin / commands / gun / examples / angular / src / app / gun.service.ts View on Github external
import { NgModule, Injectable } from '@angular/core';
import Gun from 'gun/gun';

@Injectable()
export class GunDb {
    readonly gun = Gun(location.origin + '/gun');
}

gun

A realtime, decentralized, offline-first, graph data synchronization engine.

(Zlib OR MIT OR Apache-2.0)
Latest version published 8 months ago

Package Health Score

69 / 100
Full package analysis