repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/domain_sections/routing.js
src/nginxconfig/i18n/pt-br/templates/domain_sections/routing.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/domain_sections/presets.js
src/nginxconfig/i18n/pt-br/templates/domain_sections/presets.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/domain_sections/server.js
src/nginxconfig/i18n/pt-br/templates/domain_sections/server.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/domain_sections/reverse_proxy.js
src/nginxconfig/i18n/pt-br/templates/domain_sections/reverse_proxy.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/domain_sections/logging.js
src/nginxconfig/i18n/pt-br/templates/domain_sections/logging.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/callouts/index.js
src/nginxconfig/i18n/pt-br/templates/callouts/index.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/callouts/contribute.js
src/nginxconfig/i18n/pt-br/templates/callouts/contribute.js
/* Copyright 2021 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/i18n/pt-br/templates/callouts/droplet.js
src/nginxconfig/i18n/pt-br/templates/callouts/droplet.js
/* Copyright 2021 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/index.js
src/nginxconfig/generators/index.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/to_yaml.js
src/nginxconfig/generators/to_yaml.js
/* Copyright 2022 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/to_conf.js
src/nginxconfig/generators/to_conf.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/ext/docker.js
src/nginxconfig/generators/ext/docker.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/yaml/dockerCompose.yaml.js
src/nginxconfig/generators/yaml/dockerCompose.yaml.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/proxy.conf.js
src/nginxconfig/generators/conf/proxy.conf.js
/* Copyright 2022 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/drupal.conf.js
src/nginxconfig/generators/conf/drupal.conf.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/python_uwsgi.conf.js
src/nginxconfig/generators/conf/python_uwsgi.conf.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/nginx.conf.js
src/nginxconfig/generators/conf/nginx.conf.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/joomla.conf.js
src/nginxconfig/generators/conf/joomla.conf.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/security.conf.js
src/nginxconfig/generators/conf/security.conf.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/magento.conf.js
src/nginxconfig/generators/conf/magento.conf.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/website.conf.js
src/nginxconfig/generators/conf/website.conf.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/php_fastcgi.conf.js
src/nginxconfig/generators/conf/php_fastcgi.conf.js
/* Copyright 2021 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/letsencrypt.conf.js
src/nginxconfig/generators/conf/letsencrypt.conf.js
/* Copyright 2020 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/general.conf.js
src/nginxconfig/generators/conf/general.conf.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/generators/conf/wordpress.conf.js
src/nginxconfig/generators/conf/wordpress.conf.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/build/webpack-dynamic-import.js
src/nginxconfig/build/webpack-dynamic-import.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/build/template.js
src/nginxconfig/build/template.js
/* Copyright 2022 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/build/prism.js
src/nginxconfig/build/prism.js
/* Copyright 2022 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/templates/setup_sections/index.js
src/nginxconfig/templates/setup_sections/index.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/templates/global_sections/index.js
src/nginxconfig/templates/global_sections/index.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/src/nginxconfig/templates/domain_sections/index.js
src/nginxconfig/templates/domain_sections/index.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
digitalocean/nginxconfig.io
https://github.com/digitalocean/nginxconfig.io/blob/dd290c0b706b8a8c2f86cfbffaae9c17715b431d/test/testBrowserLanguage.js
test/testBrowserLanguage.js
/* Copyright 2024 DigitalOcean This code is licensed under the MIT License. You may obtain a copy of the License at https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE or https://mit-license.org/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associate...
javascript
MIT
dd290c0b706b8a8c2f86cfbffaae9c17715b431d
2026-01-04T15:02:09.359615Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/rollup.config.js
rollup.config.js
import buble from '@rollup/plugin-buble' import replace from '@rollup/plugin-replace' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import { terser } from 'rollup-plugin-terser' import pkg from './package.json' const banner = `/*! * vuex v${pkg.version} * (c) ${new ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/jest.config.js
jest.config.js
module.exports = { rootDir: __dirname, testEnvironment: 'jsdom', globals: { __DEV__: true }, moduleNameMapper: { '^@/(.*)$': '<rootDir>/src/$1', '^test/(.*)$': '<rootDir>/test/$1' }, testMatch: ['<rootDir>/test/**/*.spec.js'], testPathIgnorePatterns: ['/node_modules/'], setupFilesAfterEnv:...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/scripts/release.js
scripts/release.js
const fs = require('fs') const path = require('path') const chalk = require('chalk') const semver = require('semver') const { prompt } = require('enquirer') const execa = require('execa') const currentVersion = require('../package.json').version const versionIncrements = [ 'patch', 'minor', 'major' ] const tags...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/scripts/build.js
scripts/build.js
const fs = require('fs-extra') const chalk = require('chalk') const execa = require('execa') const { gzipSync } = require('zlib') const { compress } = require('brotli') const files = [ 'dist/vuex.esm-browser.js', 'dist/vuex.esm-browser.prod.js', 'dist/vuex.esm-bundler.js', 'dist/vuex.global.js', 'dist/vuex.g...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/index.js
src/index.js
import { Store, createStore } from './store' import { storeKey, useStore } from './injectKey' import { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from './helpers' import { createLogger } from './plugins/logger' export default { version: '__VERSION__', Store, storeKey, createStore...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/injectKey.js
src/injectKey.js
import { inject } from 'vue' export const storeKey = 'store' export function useStore (key = null) { return inject(key !== null ? key : storeKey) }
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/index.cjs.js
src/index.cjs.js
import { Store, createStore } from './store' import { storeKey, useStore } from './injectKey' import { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from './helpers' import { createLogger } from './plugins/logger' export default { version: '__VERSION__', Store, storeKey, createStore...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/store-util.js
src/store-util.js
import { reactive, computed, watch, effectScope } from 'vue' import { forEachValue, isObject, isPromise, assert, partial } from './util' export function genericSubscribe (fn, subs, options) { if (subs.indexOf(fn) < 0) { options && options.prepend ? subs.unshift(fn) : subs.push(fn) } return () => ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/store.js
src/store.js
import { watch } from 'vue' import { storeKey } from './injectKey' import { addDevtools } from './plugins/devtool' import ModuleCollection from './module/module-collection' import { assert } from './util' import { genericSubscribe, getNestedState, installModule, resetStore, resetStoreState, unifyObjectStyle...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/helpers.js
src/helpers.js
import { isObject } from './util' /** * Reduce the code which written in Vue.js for getting the state. * @param {String} [namespace] - Module's namespace * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it. * @p...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/util.js
src/util.js
/** * Get the first item that pass the test * by second argument function * * @param {Array} list * @param {Function} f * @return {*} */ export function find (list, f) { return list.filter(f)[0] } /** * Deep copy the given object considering circular structure. * This function caches all nested objects and ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/plugins/devtool.js
src/plugins/devtool.js
import { setupDevtoolsPlugin } from '@vue/devtools-api' import { makeLocalGetters } from '../store-util' const LABEL_VUEX_BINDINGS = 'vuex bindings' const MUTATIONS_LAYER_ID = 'vuex:mutations' const ACTIONS_LAYER_ID = 'vuex:actions' const INSPECTOR_ID = 'vuex' let actionId = 0 export function addDevtools (app, store...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/plugins/logger.js
src/plugins/logger.js
// Credits: borrowed code from fcomb/redux-logger import { deepCopy } from '../util' export function createLogger ({ collapsed = true, filter = (mutation, stateBefore, stateAfter) => true, transformer = state => state, mutationTransformer = mut => mut, actionFilter = (action, state) => true, actionTransfo...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/module/module-collection.js
src/module/module-collection.js
import Module from './module' import { assert, forEachValue } from '../util' export default class ModuleCollection { constructor (rawRootModule) { // register root module (Vuex.Store options) this.register([], rawRootModule, false) } get (path) { return path.reduce((module, key) => { return mo...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/src/module/module.js
src/module/module.js
import { forEachValue } from '../util' // Base data struct for store's module, package with some attribute and method export default class Module { constructor (rawModule, runtime) { this.runtime = runtime // Store some children item this._children = Object.create(null) // Store the origin module obj...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/setup.js
test/setup.js
import 'regenerator-runtime/runtime'
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/helpers.js
test/helpers.js
import { createApp } from 'vue' import puppeteer from 'puppeteer' export function mount (store, component) { const el = createElement() component.render = component.render || (() => {}) const app = createApp(component) app.use(store) return app.mount(el) } function createElement () { const el = docume...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/esm/esm-test.js
test/esm/esm-test.js
// only test esm entry points on Node.14 or higher const [major] = process.versions.node.split('.') if (+major >= 14) { (async function () { await import('./esm-import.mjs') })().catch(console.error) }
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/e2e/counter.spec.js
test/e2e/counter.spec.js
import { setupPuppeteer, E2E_TIMEOUT } from 'test/helpers' describe('e2e/counter', () => { const { page, text, click, sleep } = setupPuppeteer() async function testCounter (url) { await page().goto(url) expect(await text('#app')).toContain('Clicked: 0 times') await click('button:nth-child(1)') ex...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/e2e/cart.spec.js
test/e2e/cart.spec.js
import { setupPuppeteer, E2E_TIMEOUT } from 'test/helpers' describe('e2e/cart', () => { const { page, text, count, click, sleep } = setupPuppeteer() async function testCart (url) { await page().goto(url) await sleep(120) // api simulation expect(await count('li')).toBe(3) expect(await count('.ca...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/e2e/chat.spec.js
test/e2e/chat.spec.js
import { setupPuppeteer, E2E_TIMEOUT } from 'test/helpers' describe('e2e/chat', () => { const { page, text, count, click, enterValue, sleep } = setupPuppeteer() async function testChat (url) { await page().goto(url) expect(await text('.thread-count')).toContain('Unread threads: 2') expect(await count...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/e2e/todomvc.spec.js
test/e2e/todomvc.spec.js
import { setupPuppeteer, E2E_TIMEOUT } from 'test/helpers' describe('e2e/todomvc', () => { const { page, isVisible, isChecked, isFocused, text, value, count, hasClass, hover, click, keyUp, setValue, enterValue, clearValue } = setupPuppeteer() async functio...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/unit/util.spec.js
test/unit/util.spec.js
import { find, deepCopy, forEachValue, isObject, isPromise, assert } from '@/util' describe('util', () => { it('find: returns item when it was found', () => { const list = [33, 22, 112, 222, 43] expect(find(list, function (a) { return a % 2 === 0 })).toEqual(22) }) it('find: returns undefined when item ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/unit/helpers.spec.js
test/unit/helpers.spec.js
import { mount } from 'test/helpers' import Vuex, { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from '@/index' describe('Helpers', () => { it('mapState (array)', () => { const store = new Vuex.Store({ state: { a: 1 } }) const vm = mount(store, { com...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/unit/hot-reload.spec.js
test/unit/hot-reload.spec.js
import { nextTick } from 'vue' import { mount } from 'test/helpers' import Vuex from '@/index' const TEST = 'TEST' const isSSR = process.env.VUE_ENV === 'server' describe('Hot Reload', () => { it('mutations', function () { const mutations = { [TEST] (state, n) { state.a += n } } cons...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/unit/store.spec.js
test/unit/store.spec.js
import { nextTick } from 'vue' import { mount } from 'test/helpers' import Vuex from '@/index' const TEST = 'TEST' const isSSR = process.env.VUE_ENV === 'server' describe('Store', () => { it('committing mutations', () => { const store = new Vuex.Store({ state: { a: 1 }, mutations: { ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/unit/modules.spec.js
test/unit/modules.spec.js
import { h, nextTick } from 'vue' import { mount } from 'test/helpers' import Vuex from '@/index' const TEST = 'TEST' describe('Modules', () => { describe('module registration', () => { it('dynamic module registration', () => { const store = new Vuex.Store({ strict: true, modules: { ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/unit/module/module-collection.spec.js
test/unit/module/module-collection.spec.js
import ModuleCollection from '@/module/module-collection' describe('ModuleCollection', () => { it('get', () => { const collection = new ModuleCollection({ state: { value: 1 }, modules: { a: { state: { value: 2 } }, b: { state: { value: 3 }, module...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/test/unit/module/module.spec.js
test/unit/module/module.spec.js
import Module from '@/module/module' describe('Module', () => { it('get state', () => { const module = new Module({ state: { value: true } }) expect(module.state).toEqual({ value: true }) }) it('get state: should return object if state option is empty', () => { const module =...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/docs/.vitepress/config.js
docs/.vitepress/config.js
module.exports = { lang: 'en-US', title: 'Vuex', description: 'Centralized State Management for Vue.js', locales: { '/': { lang: 'en-US', title: 'Vuex', description: 'Centralized State Management for Vue.js' }, '/zh/': { lang: 'zh-CN', title: 'Vuex', description:...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/docs/.vitepress/theme/index.js
docs/.vitepress/theme/index.js
import '../styles/styles.css' import DefaultTheme from 'vitepress/dist/client/theme-default' export default { ...DefaultTheme }
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/webpack.config.js
examples/webpack.config.js
const fs = require('fs') const path = require('path') const webpack = require('webpack') const { VueLoaderPlugin } = require('vue-loader') function buildEntry (dirname) { const lookupDir = path.join(__dirname, dirname) return fs.readdirSync(lookupDir).reduce((entries, dir) => { const fullDir = path.join(looku...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/server.js
examples/server.js
const express = require('express') const webpack = require('webpack') const webpackDevMiddleware = require('webpack-dev-middleware') const webpackHotMiddleware = require('webpack-hot-middleware') const WebpackConfig = require('./webpack.config') const app = express() const compiler = webpack(WebpackConfig) app.use(we...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/chat/app.js
examples/classic/chat/app.js
import { createApp } from 'vue' import App from './components/App.vue' import store from './store' import { getAllMessages } from './store/actions' const app = createApp(App) app.use(store) app.mount('#app') getAllMessages(store)
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/chat/store/getters.js
examples/classic/chat/store/getters.js
export const threads = state => state.threads export const currentThread = state => { return state.currentThreadID ? state.threads[state.currentThreadID] : {} } export const currentMessages = state => { const thread = currentThread(state) return thread.messages ? thread.messages.map(id => state.mess...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/chat/store/index.js
examples/classic/chat/store/index.js
import { createStore, createLogger } from 'vuex' import * as getters from './getters' import * as actions from './actions' import mutations from './mutations' const state = { currentThreadID: null, threads: { /* id: { id, name, messages: [...ids], lastMessage } */ }, mes...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/chat/store/mutations.js
examples/classic/chat/store/mutations.js
export default { receiveAll (state, messages) { let latestMessage messages.forEach(message => { // create new thread if the thread doesn't exist if (!state.threads[message.threadID]) { createThread(state, message.threadID, message.threadName) } // mark the latest message ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/chat/store/actions.js
examples/classic/chat/store/actions.js
import * as api from '../api' export const getAllMessages = ({ commit }) => { api.getAllMessages(messages => { commit('receiveAll', messages) }) } export const sendMessage = ({ commit }, payload) => { api.createMessage(payload, message => { commit('receiveMessage', message) }) } export const switchTh...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/chat/api/index.js
examples/classic/chat/api/index.js
const data = require('./mock-data') const LATENCY = 16 export function getAllMessages (cb) { setTimeout(() => { cb(data) }, LATENCY) } export function createMessage ({ text, thread }, cb) { const timestamp = Date.now() const id = 'm_' + timestamp const message = { id, text, timestamp, th...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/chat/api/mock-data.js
examples/classic/chat/api/mock-data.js
module.exports = [ { id: 'm_1', threadID: 't_1', threadName: 'Jing and Bill', authorName: 'Bill', text: 'Hey Jing, want to give a Flux talk at ForwardJS?', timestamp: Date.now() - 99999 }, { id: 'm_2', threadID: 't_1', threadName: 'Jing and Bill', authorName: 'Bill', te...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/todomvc/app.js
examples/classic/todomvc/app.js
import { createApp } from 'vue' import store from './store' import App from './components/App.vue' const app = createApp(App) app.use(store) app.mount('#app')
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/todomvc/store/plugins.js
examples/classic/todomvc/store/plugins.js
import { createLogger } from 'vuex' import { STORAGE_KEY } from './mutations' const localStoragePlugin = store => { store.subscribe((mutation, { todos }) => { window.localStorage.setItem(STORAGE_KEY, JSON.stringify(todos)) }) } export default process.env.NODE_ENV !== 'production' ? [createLogger(), localSto...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/todomvc/store/index.js
examples/classic/todomvc/store/index.js
import { createStore } from 'vuex' import { mutations, STORAGE_KEY } from './mutations' import actions from './actions' import plugins from './plugins' export default createStore({ state: { todos: JSON.parse(window.localStorage.getItem(STORAGE_KEY) || '[]') }, actions, mutations, plugins })
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/todomvc/store/mutations.js
examples/classic/todomvc/store/mutations.js
export const STORAGE_KEY = 'todos-vuejs' // for testing if (navigator.webdriver) { window.localStorage.clear() } export const mutations = { addTodo (state, todo) { state.todos.push(todo) }, removeTodo (state, todo) { state.todos.splice(state.todos.indexOf(todo), 1) }, editTodo (state, { todo, te...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/todomvc/store/actions.js
examples/classic/todomvc/store/actions.js
export default { addTodo ({ commit }, text) { commit('addTodo', { text, done: false }) }, removeTodo ({ commit }, todo) { commit('removeTodo', todo) }, toggleTodo ({ commit }, todo) { commit('editTodo', { todo, done: !todo.done }) }, editTodo ({ commit }, { todo, value }) { ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/counter-hot/app.js
examples/classic/counter-hot/app.js
import { createApp } from 'vue' import store from './store' import CounterControls from './CounterControls.vue' const app = createApp(CounterControls) app.use(store) app.mount('#app')
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/counter-hot/store/getters.js
examples/classic/counter-hot/store/getters.js
export const count = state => state.count export const recentHistory = state => { return state.history .slice(-5) .join(', ') }
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/counter-hot/store/index.js
examples/classic/counter-hot/store/index.js
import { createStore } from 'vuex' import * as getters from './getters' import * as actions from './actions' import * as mutations from './mutations' const state = { count: 0, history: [] } const store = createStore({ state, getters, actions, mutations }) if (module.hot) { module.hot.accept([ './ge...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/counter-hot/store/mutations.js
examples/classic/counter-hot/store/mutations.js
export const increment = state => { state.count++ state.history.push('increment') } export const decrement = state => { state.count-- state.history.push('decrement') }
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/counter-hot/store/actions.js
examples/classic/counter-hot/store/actions.js
export const increment = ({ commit }) => { commit('increment') } export const decrement = ({ commit }) => { commit('decrement') } export const incrementIfOdd = ({ commit, state }) => { if ((state.count + 1) % 2 === 0) { commit('increment') } } export const incrementAsync = ({ commit }) => { setTimeout((...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/counter/app.js
examples/classic/counter/app.js
import { createApp } from 'vue' import Counter from './Counter.vue' import store from './store' const app = createApp(Counter) app.use(store) app.mount('#app')
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/counter/store.js
examples/classic/counter/store.js
import { createStore } from 'vuex' // root state object. // each Vuex instance is just a single state tree. const state = { count: 0 } // mutations are operations that actually mutate the state. // each mutation handler gets the entire state tree as the // first argument, followed by additional payload arguments. /...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/shopping-cart/app.js
examples/classic/shopping-cart/app.js
import { createApp } from 'vue' import App from './components/App.vue' import store from './store' import { currency } from './currency' const app = createApp(App) app.use(store) app.mount('#app')
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/shopping-cart/currency.js
examples/classic/shopping-cart/currency.js
const digitsRE = /(\d{3})(?=\d)/g export function currency (value, currency, decimals) { value = parseFloat(value) if (!isFinite(value) || (!value && value !== 0)) return '' currency = currency != null ? currency : '$' decimals = decimals != null ? decimals : 2 var stringified = Math.abs(value).toFixed(decim...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/shopping-cart/store/index.js
examples/classic/shopping-cart/store/index.js
import { createStore, createLogger } from 'vuex' import cart from './modules/cart' import products from './modules/products' const debug = process.env.NODE_ENV !== 'production' export default createStore({ modules: { cart, products }, strict: debug, plugins: debug ? [createLogger()] : [] })
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/shopping-cart/store/modules/products.js
examples/classic/shopping-cart/store/modules/products.js
import shop from '../../api/shop' // initial state const state = () => ({ all: [] }) // getters const getters = {} // actions const actions = { async getAllProducts ({ commit }) { const products = await shop.getProducts() commit('setProducts', products) } } // mutations const mutations = { setProduc...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/shopping-cart/store/modules/nested.js
examples/classic/shopping-cart/store/modules/nested.js
export default { namespaced: true, state: () => ({ foo: 'bar' }), getters: { twoBars: state => state.foo.repeat(2) } }
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/shopping-cart/store/modules/cart.js
examples/classic/shopping-cart/store/modules/cart.js
import shop from '../../api/shop' import nested from './nested' // initial state // shape: [{ id, quantity }] const state = () => ({ items: [], checkoutStatus: null }) // getters const getters = { cartProducts: (state, getters, rootState) => { return state.items.map(({ id, quantity }) => { const produ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/classic/shopping-cart/api/shop.js
examples/classic/shopping-cart/api/shop.js
/** * Mocking client-server processing */ const _products = [ { 'id': 1, 'title': 'iPad 4 Mini', 'price': 500.01, 'inventory': 2 }, { 'id': 2, 'title': 'H&M T-Shirt White', 'price': 10.99, 'inventory': 10 }, { 'id': 3, 'title': 'Charli XCX - Sucker CD', 'price': 19.99, 'inventory': 5 } ] export default { asy...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/chat/app.js
examples/composition/chat/app.js
import { createApp } from 'vue' import App from './components/App.vue' import store from './store' import { getAllMessages } from './store/actions' const app = createApp(App) app.use(store) app.mount('#app') getAllMessages(store)
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/chat/store/getters.js
examples/composition/chat/store/getters.js
export const threads = state => state.threads export const currentThread = state => { return state.currentThreadID ? state.threads[state.currentThreadID] : {} } export const currentMessages = state => { const thread = currentThread(state) return thread.messages ? thread.messages.map(id => state.mess...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/chat/store/index.js
examples/composition/chat/store/index.js
import { createStore, createLogger } from 'vuex' import * as getters from './getters' import * as actions from './actions' import mutations from './mutations' const state = { currentThreadID: null, threads: { /* id: { id, name, messages: [...ids], lastMessage } */ }, mes...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/chat/store/mutations.js
examples/composition/chat/store/mutations.js
export default { receiveAll (state, messages) { let latestMessage messages.forEach(message => { // create new thread if the thread doesn't exist if (!state.threads[message.threadID]) { createThread(state, message.threadID, message.threadName) } // mark the latest message ...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/chat/store/actions.js
examples/composition/chat/store/actions.js
import * as api from '../api' export const getAllMessages = ({ commit }) => { api.getAllMessages(messages => { commit('receiveAll', messages) }) } export const sendMessage = ({ commit }, payload) => { api.createMessage(payload, message => { commit('receiveMessage', message) }) } export const switchTh...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/chat/api/index.js
examples/composition/chat/api/index.js
const data = require('./mock-data') const LATENCY = 16 export function getAllMessages (cb) { setTimeout(() => { cb(data) }, LATENCY) } export function createMessage ({ text, thread }, cb) { const timestamp = Date.now() const id = 'm_' + timestamp const message = { id, text, timestamp, th...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/chat/api/mock-data.js
examples/composition/chat/api/mock-data.js
module.exports = [ { id: 'm_1', threadID: 't_1', threadName: 'Jing and Bill', authorName: 'Bill', text: 'Hey Jing, want to give a Flux talk at ForwardJS?', timestamp: Date.now() - 99999 }, { id: 'm_2', threadID: 't_1', threadName: 'Jing and Bill', authorName: 'Bill', te...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/todomvc/app.js
examples/composition/todomvc/app.js
import { createApp } from 'vue' import store from './store' import App from './components/App.vue' const app = createApp(App) app.use(store) app.mount('#app')
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false
vuejs/vuex
https://github.com/vuejs/vuex/blob/bd907467b8392d6671bb115738285ff7f63d0cf6/examples/composition/todomvc/store/plugins.js
examples/composition/todomvc/store/plugins.js
import { createLogger } from 'vuex' import { STORAGE_KEY } from './mutations' const localStoragePlugin = store => { store.subscribe((mutation, { todos }) => { window.localStorage.setItem(STORAGE_KEY, JSON.stringify(todos)) }) } export default process.env.NODE_ENV !== 'production' ? [createLogger(), localSto...
javascript
MIT
bd907467b8392d6671bb115738285ff7f63d0cf6
2026-01-04T15:02:06.558064Z
false