Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

chore: curry extrinsic effect factory #372

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

harrysolovay
Copy link
Contributor

@harrysolovay harrysolovay commented Nov 9, 2022

A previous PR introduced currying of the (client) first param of RPC effect factories. The thinking was that this would simplify codegen. One could effectively swap out a single statement in a generated file to inform the discovery value and RPC error signatures. Aka.

generated.ts

// codegen-replacement-start
declare const client: Effect<rpc.Client<any, any, any, any>, Error>;
// codegen-replacement-end

export const getMetadata = C.state.getMetadata(client);

Then, the user could import generated.ts and interact with the effect factory without needing to think about the client's provider type and discovery value.

This PR does the same for the extrinsic effect factory. More to come later.

@harrysolovay harrysolovay force-pushed the curry-extrinsic-effect-fac branch from 2cd107c to 1d77a04 Compare November 9, 2022 19:52
Copy link
Contributor

@kratico kratico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harrysolovay harrysolovay merged commit 85e4078 into main Nov 9, 2022
@harrysolovay harrysolovay deleted the curry-extrinsic-effect-fac branch November 9, 2022 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants