Convex is the global state management platform for web developers.
1 2 3 4 5 6
import { query } from "convex-dev/server"; // List all chat messages. export default query(async ({ db }) => { return await db.table("messages").collect(); });
1 2 3 4 5 6 7
import { mutation } from "convex-dev/server"; // Send a chat message. export default mutation(({ db }, body: string) => { const message = { body, time: Date.now() }; db.insert("messages", message); });
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
function App() { // Reactively load the current messages. const messages = useQuery("listMessages") ?? []; // Send a message using a mutation. const sendMessage = useMutation("sendMessage"); return ( <div> {messages.map( message => <Message message={message} /> )} <button onClick={() => sendMessage("hello")}> Say Hello </button> </div> ) }
Convex tracks all changes to your global state. When any client updates shared state, React components around the world automatically re-render.
Between serializable snapshot isolated mutations and fully consistent, reactive queries, Convex handles correctness so you don't have to.
Convex caches all of your application's state automatically. The cache is automatically invalidated and always correct so you get performance and scale out of the box.
Sign up for our beta waitlist to get access soon.
...and more than 80 angels, including: