├── .env ├── .eslintignore ├── .eslintrc.base.json ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── 1-bug-report.yaml │ ├── 2-feature-request.yaml │ └── 3-support-request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── ci.yml │ └── gh-pages.yml ├── .gitignore ├── .husky └── commit-msg ├── .prettierignore ├── .prettierrc ├── .vscode └── extensions.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md ├── changelog.config.js ├── devtools ├── .eslintrc.json ├── CHANGELOG.md ├── README.md ├── jest.config.ts ├── ng-package.json ├── package.json ├── project.json ├── src │ ├── index.ts │ ├── lib │ │ └── devtools │ │ │ └── devtools.ts │ └── test-setup.ts ├── tsconfig.json ├── tsconfig.lib.json ├── tsconfig.lib.prod.json └── tsconfig.spec.json ├── e2e ├── .eslintrc.json ├── playwright.config.ts ├── project.json └── src │ └── example.spec.ts ├── jest.config.app.ts ├── jest.config.ts ├── jest.preset.js ├── migrations.json ├── nx.json ├── package-lock.json ├── package.json ├── packages └── devtools │ └── package-lock.json ├── project.json ├── query ├── .eslintrc.json ├── CHANGELOG.md ├── README.md ├── jest.config.ts ├── ng-package.json ├── package.json ├── project.json ├── src │ ├── index.ts │ ├── lib │ │ ├── base-query.ts │ │ ├── infinite-query.ts │ │ ├── is-fetching.ts │ │ ├── is-mutating.ts │ │ ├── mutation.ts │ │ ├── operators.ts │ │ ├── query-client-options.ts │ │ ├── query-client.ts │ │ ├── query-options.ts │ │ ├── query.ts │ │ ├── signals.ts │ │ ├── types.ts │ │ └── utils.ts │ ├── test-setup.ts │ └── tests │ │ ├── infinite-query.spec.ts │ │ ├── is-fetching.spec.ts │ │ ├── is-mutating.spec.ts │ │ ├── mutation.spec.ts │ │ ├── operators.spec.ts │ │ ├── query-client.spec.ts │ │ ├── query.spec.ts │ │ ├── signals.spec.ts │ │ └── test-helper.ts ├── tsconfig.json ├── tsconfig.lib.json ├── tsconfig.lib.prod.json └── tsconfig.spec.json ├── src ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.ts │ ├── app.config.ts │ ├── app.routes.ts │ ├── basic-page │ │ ├── todos-page.component.html │ │ └── todos-page.component.ts │ ├── dynamic-page │ │ ├── dynamic-page.component.html │ │ ├── dynamic-page.component.scss │ │ └── dynamic-page.component.ts │ ├── infinite-scroll-page │ │ ├── in-view.directive.ts │ │ ├── posts-page.component.html │ │ ├── posts-page.component.ts │ │ └── posts.service.ts │ ├── intersecting-page │ │ ├── intersecting-page.component.html │ │ └── intersecting-page.component.ts │ ├── mutation-page │ │ ├── mutation-page.component.html │ │ └── mutation-page.component.ts │ ├── pagination-page │ │ ├── pagination-page.component.html │ │ ├── pagination-page.component.scss │ │ ├── pagination-page.component.ts │ │ └── pagination-service.ts │ ├── prefetch-page │ │ ├── prefetch-page.component.html │ │ ├── prefetch-page.component.ts │ │ └── resolve.ts │ ├── services │ │ ├── notification.service.ts │ │ ├── todos.service.ts │ │ └── users.service.ts │ └── ui │ │ ├── query-tab │ │ ├── tab.component.html │ │ └── tab.component.ts │ │ └── query-tabs │ │ ├── tabs.component.html │ │ └── tabs.component.ts ├── assets │ ├── .gitkeep │ └── ngneat.png ├── environments │ ├── environment.development.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── styles.scss └── test-setup.ts ├── tsconfig.app.json ├── tsconfig.base.json ├── tsconfig.editor.json ├── tsconfig.json └── tsconfig.spec.json /.env: -------------------------------------------------------------------------------- 1 | # Nx 18 enables using plugins to infer targets by default 2 | # This is disabled for existing workspaces to maintain compatibility 3 | # For more info, see: https://nx.dev/concepts/inferred-tasks 4 | NX_ADD_PLUGINS=false -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.eslintrc.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": ["**/*"], 4 | "plugins": ["@nx"], 5 | "overrides": [ 6 | { 7 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 8 | "rules": { 9 | "@nx/enforce-module-boundaries": [ 10 | "error", 11 | { 12 | "enforceBuildableLibDependency": true, 13 | "allow": [], 14 | "depConstraints": [ 15 | { 16 | "sourceTag": "*", 17 | "onlyDependOnLibsWithTags": ["*"] 18 | } 19 | ] 20 | } 21 | ] 22 | } 23 | }, 24 | { 25 | "files": ["*.ts", "*.tsx"], 26 | "extends": ["plugin:@nx/typescript"], 27 | "rules": { 28 | "@typescript-eslint/no-explicit-any": "off" 29 | } 30 | }, 31 | { 32 | "files": ["*.js", "*.jsx"], 33 | "extends": ["plugin:@nx/javascript"], 34 | "rules": {} 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": ["!**/*"], 3 | "overrides": [ 4 | { 5 | "files": ["*.ts"], 6 | "extends": [ 7 | "plugin:@nx/angular", 8 | "plugin:@angular-eslint/template/process-inline-templates" 9 | ], 10 | "rules": { 11 | "@typescript-eslint/no-inferrable-types": "off", 12 | "@angular-eslint/directive-selector": [ 13 | "error", 14 | { 15 | "type": "attribute", 16 | "prefix": "query", 17 | "style": "camelCase" 18 | } 19 | ], 20 | "@angular-eslint/component-selector": [ 21 | "error", 22 | { 23 | "type": "element", 24 | "prefix": "query", 25 | "style": "kebab-case" 26 | } 27 | ], 28 | "@angular-eslint/prefer-standalone": "off" 29 | } 30 | }, 31 | { 32 | "files": ["*.html"], 33 | "extends": ["plugin:@nx/angular-template"], 34 | "rules": {} 35 | } 36 | ], 37 | "extends": ["./.eslintrc.base.json"] 38 | } 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/1-bug-report.yaml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Report a bug in the ngneat/query Library 3 | 4 | body: 5 | - type: dropdown 6 | id: affected-packages 7 | attributes: 8 | label: Which @ngneat/query-* package(s) are the source of the bug? 9 | options: 10 | - query 11 | - devtools 12 | - Don't known / other 13 | multiple: true 14 | validations: 15 | required: true 16 | 17 | - type: dropdown 18 | id: is-regression 19 | attributes: 20 | label: Is this a regression? 21 | options: 22 | - 'Yes' 23 | - 'No' 24 | validations: 25 | required: true 26 | 27 | - type: textarea 28 | id: description 29 | attributes: 30 | label: Description 31 | validations: 32 | required: true 33 | 34 | - type: input 35 | id: reproduction 36 | attributes: 37 | label: Please provide a link to a minimal reproduction of the bug 38 | 39 | - type: textarea 40 | id: exception-or-error 41 | attributes: 42 | label: Please provide the exception or error you saw 43 | render: true 44 | 45 | - type: textarea 46 | id: environment 47 | attributes: 48 | label: Please provide the environment you discovered this bug in 49 | render: true 50 | 51 | - type: textarea 52 | id: other 53 | attributes: 54 | label: Anything else? 55 | 56 | - type: dropdown 57 | id: contribute 58 | attributes: 59 | label: Do you want to create a pull request? 60 | options: 61 | - 'Yes' 62 | - 'No' 63 | validations: 64 | required: true 65 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-feature-request.yaml: -------------------------------------------------------------------------------- 1 | name: 'Feature Request' 2 | description: Suggest a feature for ngneat/query Library 3 | 4 | body: 5 | - type: dropdown 6 | id: affected-packages 7 | attributes: 8 | label: Which @ngneat/query-* package(s) are relevant/releated to the feature request? 9 | options: 10 | - query 11 | - devtools 12 | multiple: true 13 | 14 | - type: textarea 15 | id: description 16 | attributes: 17 | label: Description 18 | validations: 19 | required: true 20 | 21 | - type: textarea 22 | id: proposed-solution 23 | attributes: 24 | label: Proposed solution 25 | validations: 26 | required: true 27 | 28 | - type: textarea 29 | id: alternatives-considered 30 | attributes: 31 | label: Alternatives considered 32 | validations: 33 | required: true 34 | 35 | - type: dropdown 36 | id: contribute 37 | attributes: 38 | label: Do you want to create a pull request? 39 | options: 40 | - 'Yes' 41 | - 'No' 42 | validations: 43 | required: true 44 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3-support-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Support Request' 3 | about: Questions and requests for support 4 | --- 5 | 6 | Please do not file questions or support requests on the GitHub issues tracker. 7 | 8 | You can get your questions answered using other communication channels. Please see: 9 | 10 | https://github.com/ngneat/query/discussions 11 | 12 | Thank you! 13 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## PR Checklist 2 | 3 | Please check if your PR fulfills the following requirements: 4 | 5 | - [ ] The commit message follows our guidelines: https://github.com/ngneat/query/blob/master/CONTRIBUTING.md#commit 6 | - [ ] Tests for the changes have been added (for bug fixes / features) 7 | - [ ] Docs have been added / updated (for bug fixes / features) 8 | 9 | ## PR Type 10 | 11 | What kind of change does this PR introduce? 12 | 13 | 14 | 15 | - [ ] Bugfix 16 | - [ ] Feature 17 | - [ ] Code style update (formatting, local variables) 18 | - [ ] Refactoring (no functional changes, no api changes) 19 | - [ ] Build related changes 20 | - [ ] CI related changes 21 | - [ ] Documentation content changes 22 | - [ ] Other... Please describe: 23 | 24 | ## What is the current behavior? 25 | 26 | 27 | 28 | Issue Number: N/A 29 | 30 | ## What is the new behavior? 31 | 32 | ## Does this PR introduce a breaking change? 33 | 34 | ``` 35 | [ ] Yes 36 | [ ] No 37 | ``` 38 | 39 | 40 | 41 | ## Other information 42 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: '@ngneat/query' 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | - name: Cache node modules 16 | uses: actions/cache@v4 17 | env: 18 | cache-name: cache-node-modules 19 | with: 20 | path: ~/.npm 21 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} 22 | restore-keys: | 23 | ${{ runner.os }}-build-${{ env.cache-name }}- 24 | ${{ runner.os }}-build- 25 | ${{ runner.os }}- 26 | - uses: actions/setup-node@v4 27 | with: 28 | node-version: '18' 29 | cache: 'npm' 30 | 31 | - name: Install dependencies 32 | run: npm i 33 | 34 | - name: Run Lint 35 | run: npm run lint:all 36 | 37 | - name: Run Build 38 | run: npm run build:all 39 | 40 | - name: Run tests 41 | run: npm run test:all 42 | -------------------------------------------------------------------------------- /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy playground to GitHub pages 2 | on: 3 | push: 4 | branches: 5 | - main 6 | workflow_dispatch: 7 | permissions: 8 | contents: read 9 | pages: write 10 | id-token: write 11 | jobs: 12 | deploy: 13 | environment: 14 | name: github-pages 15 | url: ${{ steps.deployment.outputs.page_url }} 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v3 19 | - uses: actions/setup-node@v3 20 | with: 21 | node-version: 18 22 | cache: 'npm' 23 | - name: Install and Build 24 | run: | 25 | npm i 26 | npx nx build query-playground -- --base-href /query/ 27 | - name: Duplicated index.html 28 | run: | 29 | cp dist/query-playground/index.html dist/query-playground/404.html 30 | - name: Setup Pages 31 | uses: actions/configure-pages@v2 32 | - name: Upload artifact 33 | uses: actions/upload-pages-artifact@v1 34 | with: 35 | path: './dist/query-playground' 36 | - name: Deploy to GitHub Pages 37 | id: deployment 38 | uses: actions/deploy-pages@v1 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist 5 | tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | 41 | .nx/cache 42 | .nx/workspace-data 43 | .angular 44 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | /dist 4 | /coverage 5 | .angular 6 | .nx 7 | 8 | /.nx/workspace-data -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "esbenp.prettier-vscode", 5 | "firsttris.vscode-jest-runner", 6 | "ms-playwright.playwright", 7 | "dbaeumer.vscode-eslint" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | - Using welcoming and inclusive language 12 | - Being respectful of differing viewpoints and experiences 13 | - Gracefully accepting constructive criticism 14 | - Focusing on what is best for the community 15 | - Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | - Trolling, insulting/derogatory comments, and personal or political attacks 21 | - Public or private harassment 22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | - Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at netanel7799@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Query 2 | 3 | 🙏 We would ❤️ for you to contribute to `ngneat/query` and help make it even better than it is today! 4 | 5 | ## Developing 6 | 7 | - Run `npm i` 8 | - Run `npm start` 9 | 10 | ## Coding Rules 11 | 12 | To ensure consistency throughout the source code, keep these rules in mind as you are working: 13 | 14 | - All features or bug fixes **must be tested** by one or more specs (unit-tests). 15 | - All public API methods **must be documented**. 16 | 17 | ## Commit Message Guidelines 18 | 19 | We have very precise rules over how our git commit messages can be formatted. This leads to **more 20 | readable messages** that are easy to follow when looking through the **project history**. But also, 21 | we use the git commit messages to **generate the query changelog**. 22 | 23 | ### Commit Message Format 24 | 25 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special 26 | format that includes a **type**, a **scope** and a **subject**: 27 | 28 | ``` 29 | (): 30 | 31 | 32 | 33 |