Last active
May 17, 2024 03:40
-
-
Save PatrickJS/e26269f706b145b11b062e0f5b653e37 to your computer and use it in GitHub Desktop.
whats better server$ api?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getData = server$((myArg) => { | |
console.log(myArg) | |
}); | |
getData(new ServerConfig({ | |
method: 'get' | |
}), myArg) | |
getData(serverConfig({ | |
method: 'get' | |
}), myArg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getData = server$({ | |
method: 'get' | |
}, (myArg) => { | |
console.log(myArg) | |
}) | |
getData(myArg) | |
const getData2 = server$((myArg) => { | |
console.log(myArg) | |
}) | |
getData2(myArg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getData = server$((myArg) => { | |
console.log(myArg) | |
}, { | |
method: 'get' | |
}) | |
getData(myArg) |
yeah I can update this in another pr to have 3 levels of configs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
3 configs:
I'd prefer having the object first for the definition level, it's easier to read. I don't like chaining.