Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@instantdb/react

Package Overview
Dependencies
Maintainers
3
Versions
229
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instantdb/react - npm Package Compare versions

Comparing version 0.7.5 to 0.7.6

23

dist/index.d.ts

@@ -29,2 +29,25 @@ /// <reference types="react" />

getLocalId: (name: string) => Promise<string>;
/**
* Use this to write data! You can create, update, delete, and link objects
*
* @see https://docs.instantdb.com/docs/instaml
*
* @example
* // Create a new object in the `goals` namespace
* const goalId = id();
* db.transact(tx.goals[goalId].update({title: "Get fit"}))
*
* // Update the title
* db.transact(tx.goals[goalId].update({title: "Get super fit"}))
*
* // Delete it
* db.transact(tx.goals[goalId].delete())
*
* // Or create an association:
* todoId = id();
* db.transact([
* tx.todos[todoId].update({ title: 'Go on a run' }),
* tx.goals[goalId].link({todos: todoId}),
* ])
*/
transact: (chunks: TransactionChunk | TransactionChunk[]) => void;

@@ -31,0 +54,0 @@ /**

@@ -52,2 +52,25 @@ "use strict";

};
/**
* Use this to write data! You can create, update, delete, and link objects
*
* @see https://docs.instantdb.com/docs/instaml
*
* @example
* // Create a new object in the `goals` namespace
* const goalId = id();
* db.transact(tx.goals[goalId].update({title: "Get fit"}))
*
* // Update the title
* db.transact(tx.goals[goalId].update({title: "Get super fit"}))
*
* // Delete it
* db.transact(tx.goals[goalId].delete())
*
* // Or create an association:
* todoId = id();
* db.transact([
* tx.todos[todoId].update({ title: 'Go on a run' }),
* tx.goals[goalId].link({todos: todoId}),
* ])
*/
this.transact = (chunks) => {

@@ -54,0 +77,0 @@ return this._core.transact(chunks);

@@ -29,2 +29,25 @@ /// <reference types="react" />

getLocalId: (name: string) => Promise<string>;
/**
* Use this to write data! You can create, update, delete, and link objects
*
* @see https://docs.instantdb.com/docs/instaml
*
* @example
* // Create a new object in the `goals` namespace
* const goalId = id();
* db.transact(tx.goals[goalId].update({title: "Get fit"}))
*
* // Update the title
* db.transact(tx.goals[goalId].update({title: "Get super fit"}))
*
* // Delete it
* db.transact(tx.goals[goalId].delete())
*
* // Or create an association:
* todoId = id();
* db.transact([
* tx.todos[todoId].update({ title: 'Go on a run' }),
* tx.goals[goalId].link({todos: todoId}),
* ])
*/
transact: (chunks: TransactionChunk | TransactionChunk[]) => void;

@@ -31,0 +54,0 @@ /**

@@ -47,2 +47,25 @@ var _a;

};
/**
* Use this to write data! You can create, update, delete, and link objects
*
* @see https://docs.instantdb.com/docs/instaml
*
* @example
* // Create a new object in the `goals` namespace
* const goalId = id();
* db.transact(tx.goals[goalId].update({title: "Get fit"}))
*
* // Update the title
* db.transact(tx.goals[goalId].update({title: "Get super fit"}))
*
* // Delete it
* db.transact(tx.goals[goalId].delete())
*
* // Or create an association:
* todoId = id();
* db.transact([
* tx.todos[todoId].update({ title: 'Go on a run' }),
* tx.goals[goalId].link({todos: todoId}),
* ])
*/
this.transact = (chunks) => {

@@ -49,0 +72,0 @@ return this._core.transact(chunks);

4

package.json
{
"name": "@instantdb/react",
"version": "0.7.5",
"version": "0.7.6",
"description": "Instant DB for React",

@@ -32,4 +32,4 @@ "main": "dist/index.js",

"dependencies": {
"@instantdb/core": "0.7.5"
"@instantdb/core": "0.7.6"
}
}

@@ -87,2 +87,25 @@ import {

/**
* Use this to write data! You can create, update, delete, and link objects
*
* @see https://docs.instantdb.com/docs/instaml
*
* @example
* // Create a new object in the `goals` namespace
* const goalId = id();
* db.transact(tx.goals[goalId].update({title: "Get fit"}))
*
* // Update the title
* db.transact(tx.goals[goalId].update({title: "Get super fit"}))
*
* // Delete it
* db.transact(tx.goals[goalId].delete())
*
* // Or create an association:
* todoId = id();
* db.transact([
* tx.todos[todoId].update({ title: 'Go on a run' }),
* tx.goals[goalId].link({todos: todoId}),
* ])
*/
transact = (chunks: TransactionChunk | TransactionChunk[]) => {

@@ -260,21 +283,24 @@ return this._core.transact(chunks);

</span>
${data
? `
${
data
? `
<div>
<strong>State:</strong> ${data.state.isLoading ? "Loading" : data.state.error ? "Error" : "OK"
}
<strong>State:</strong> ${
data.state.isLoading ? "Loading" : data.state.error ? "Error" : "OK"
}
</div>
<div>
${data.state.data
? `
${
data.state.data
? `
<strong>Data</strong>
<pre class="_idb-code">${JSON.stringify(data.state.data, null, 2)}</pre>
`
: data.state.error
? `
: data.state.error
? `
<strong>Error</strong>
<pre class="_idb-code">${JSON.stringify(data.state.error, null, 2)}</pre>
`
: ""
}
: ""
}
</div>

@@ -286,4 +312,4 @@ <div>

`
: `<em>Hover your cursor over an element to inspect it's data.</em>`
}
: `<em>Hover your cursor over an element to inspect it's data.</em>`
}
<style>

@@ -290,0 +316,0 @@ #_idb-collapse {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc