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

New function to just send data without waiting (and new syntax ideas) #41

Open
jwillinghalpern opened this issue Aug 17, 2024 · 0 comments

Comments

@jwillinghalpern
Copy link
Owner

The rationale for yeet is that I somewhat frequently see people wanting the behavior of OnFmReady without needing to await results from fm, that is, they just want FileMaker.PerformScript to work without worrying if it's loaded or not. One option is just to auto-implement OnFmReady when importing fmgofer, and having it automatically proxy FileMaker. Another option, is to just create a function like yeet, which is more explicit (the silly name makes that claim especially arguable, I know.)

The rationale for the new syntax ideas below is that I sometimes wish I'd chosen an options object as the second parameter from the very beginning, mimicking the fetch interface, but alas at the time I wanted the API to mirror FileMaker.PerformScript (and still think that was a pretty good idea).

// just call an fm script without waiting for response
// FMGofer.yeet('my script', {param: 'my param', scriptOption: 5});

function yeet(
  script: string, 
  options?: {
    param?: string,
    scriptOption?: number,
  }
) -> void;


// Sugar for FMGofer.PerformScriptWithOption
// const res = await FMGofer.gofer('my script', {param: 'hi', 'scriptOption: 5});

async function gofer(
  script: string,
  options: {
    param?: string,
    scriptOption?: number,
    timeout?: number,
    timeoutMessage?: string,
  }
) -> FMGPromise;
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

1 participant