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

docs/next/api/filter-api/ #7

Open
utterances-bot opened this issue Mar 2, 2020 · 8 comments
Open

docs/next/api/filter-api/ #7

utterances-bot opened this issue Mar 2, 2020 · 8 comments

Comments

@utterances-bot
Copy link

Filters API | SquirrellyJS

Filters let you pass a value through functions.

https://squirrelly.js.org/docs/next/api/filter-api/

Copy link

I get the following in the console if I do the same as described above.

"Cannot read property 'define' of undefined"

I know it's a beta. Could you tell me what the correct spelling is?

Copy link

I found the mistake.
In the code snippet, "filters" is written in small letters.
A console.log output showed that "filters" must start with a capital F

@nebrelbug
Copy link
Collaborator

Hi @littlejak20! Are you sure you're using Squirrelly v8 and not Squirrelly v7? You can install Squirrelly v8 with npm install squirrelly@beta. Since it is in beta, running npm install squirrelly downloads v7. Let me know if this solves your problem!

@littlejak20
Copy link

Sorry that I answer so late.
The problem has now been solved. I used an old beta from version 8. In Beta 0, the "F" from filter was still capitalized.

@nebrelbug
Copy link
Collaborator

@littlejak20 glad to hear the problem was resolved 🎉

Copy link

ilanl commented Aug 5, 2020

I think Filter don't allow parameters as shown here, might be an issue

I'm using v8 + Typescript
export declare type FilterFunction = (str: string) => any | Promise<any>;

@nebrelbug
Copy link
Collaborator

@ilanl filters can accept parameters, it looks like I just miswrote the type.

The problem is here. I think we should just be able to change:

export type FilterFunction = (str: string) => any | Promise<any>

to

export type FilterFunction = (str: string, ...filterParameters: any[]) => any | Promise<any>

or maybe even

export type FilterFunction = (str: any, ...filterParameters: any[]) => any | Promise<any>.

Would you be willing to submit a PR for this?

@ilanl
Copy link

ilanl commented Aug 9, 2020

For sure :) I'll submit the PR. And need to add this scenario to the tests

PR

I have a failure. Pls explain why. @nebrelbug

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

4 participants