@interface-db/solidjs
v1.0.67
Published
SolidJS client for InterfaceDB
Readme
@interface-db/solidjs
SolidJS client for InterfaceDB.
Maintained by InterfaceDB, based on the Instant source. See LICENSE.md and NOTICE for attribution.
Welcome to InterfaceDB’s SolidJS SDK.
// ༼ つ ◕_◕ ༽つ Real-time Chat
// ----------------------------------
// * Updates instantly
// * Multiplayer
// * Works offline
import { init, id } from '@interface-db/solidjs';
const db = init({
appId: import.meta.env.VITE_INSTANT_APP_ID,
});
function Chat() {
// 1. Read
const query = db.useQuery({ messages: {} });
// 2. Write
const addMessage = (message) => {
db.transact(db.tx.messages[id()].update(message));
};
// 3. Render!
return <UI data={query().data} onAdd={addMessage} />;
}Get Started
Follow the getting started tutorial to set up a live SolidJS app in under 5 minutes!
Questions?
If you have any questions, feel free to drop us a line on our issue tracker
