Skip to content

Commit

Permalink
Merge pull request #168 from lightning-js/fix/plugins-reactivity-setting
Browse files Browse the repository at this point in the history
  • Loading branch information
michielvandergeest authored Sep 26, 2024
2 parents 07f155f + 639a622 commit 1fc76b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/plugins/appstate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
*/

import { reactive } from '../lib/reactivity/reactive'
import Settings from '../settings.js'

export default {
name: 'appState',
plugin(state = {}) {
return reactive(state)
return reactive(state, Settings.get('reactivityMode'))
},
}
13 changes: 9 additions & 4 deletions src/plugins/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,21 @@ import fetchJson from '../helpers/fetchJson'
import { Log } from '../lib/log'
import { reactive } from '../lib/reactivity/reactive'

import Settings from '../settings.js'

export default {
name: 'language',
plugin(options = {}) {
let translations = {}
let dictionary = {}

const state = reactive({
language: '',
loaded: 0,
})
const state = reactive(
{
language: '',
loaded: 0,
},
Settings.get('reactivityMode')
)

const setLanguage = (language) => {
// define the dictionary
Expand Down
11 changes: 8 additions & 3 deletions src/plugins/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import { Log } from '../lib/log'
import { reactive } from '../lib/reactivity/reactive.js'

import Settings from '../settings.js'

const getValueByDotNotation = (obj, base, path) => {
const keys = path.split('.')

Expand Down Expand Up @@ -46,9 +48,12 @@ export default {
plugin(config = {}) {
let themeMap = {}

const state = reactive({
current: 'default',
})
const state = reactive(
{
current: 'default',
},
Settings.get('reactivityMode')
)

let themes = {}
let base = null
Expand Down

0 comments on commit 1fc76b4

Please sign in to comment.