Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript SDK Import file for tables #46

Open
cloutiertyler opened this issue Jun 13, 2024 · 0 comments
Open

Typescript SDK Import file for tables #46

cloutiertyler opened this issue Jun 13, 2024 · 0 comments
Assignees

Comments

@cloutiertyler
Copy link
Contributor

Currently, you have to import every table in the typescript file where you use the spacetimedb client. You also need to use it somehow to stop typescript from compiling it out.

Currently in my react client for the multi-user dungeon I have this ugly mess:

import Player from "./types/player";
import Mobile from "./types/mobile";
import Location from "./types/location";
import World from "./types/world";
import Zone from "./types/zone";
import Room from "./types/room";
import RoomChat from "./types/room_chat";
import DirectMessage from './types/direct_message';
console.log(Player, Mobile, Location, World, Zone, Room, RoomChat, DirectMessage);

I’m not sure what the correct solution for this would be but we could possibly autogen a file that takes care of this for you so you only need to have a single import and it takes care of all of this for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants