[WIP] Improve lazy proxy typing #16

Draft
thepaperpilot wants to merge 4 commits from fix/lazy-proxy-typing into main
thepaperpilot commented 2023-04-27 01:35:27 +00:00 (Migrated from github.com)

Remaining work would be:

  • Update every other feature, and any relevant utilities (like in common.tsx)
  • Implement processComputable, or remove it since it might just be redundant now
  • Remember to delete the example achievement below the constructor, that I was using to verify typing was working
  • This code doesn't work, because feature gets typed as object:
function myFeature() {
    return createLazyProxy(() => {
        const foo = "bar";
        const points = createAchievement(() => ({

        }));
        return {
            foo, points
        };
    });
}

const feature = myFeature();
feature;
feature.foo;
feature.points;

Fixes #15

Remaining work would be: - Update every other feature, and any relevant utilities (like in common.tsx) - Implement processComputable, or remove it since it might just be redundant now - Remember to delete the example achievement below the constructor, that I was using to verify typing was working - This code doesn't work, because `feature` gets typed as `object`: ```ts function myFeature() { return createLazyProxy(() => { const foo = "bar"; const points = createAchievement(() => ({ })); return { foo, points }; }); } const feature = myFeature(); feature; feature.foo; feature.points; ``` Fixes #15
profectus changed title from Improve lazy proxy typing to [WIP] Improve lazy proxy typing 2023-09-17 18:45:17 +00:00
This pull request has changes conflicting with the target branch.
  • src/features/achievements/achievement.tsx
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/lazy-proxy-typing:fix/lazy-proxy-typing
git checkout fix/lazy-proxy-typing
Sign in to join this conversation.
No description provided.