Skip to content

Commit

Permalink
Update samples (#33)
Browse files Browse the repository at this point in the history
* Update sample

* Update sample dependencies

* Update sandbox
  • Loading branch information
adams85 authored Jun 20, 2023
1 parent b5096f5 commit c82c306
Show file tree
Hide file tree
Showing 6 changed files with 297 additions and 313 deletions.
560 changes: 275 additions & 285 deletions samples/react-sdk-sample/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion samples/react-sdk-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/node": "^16.11.33",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"configcat-react": "^2.3.0",
"configcat-react": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand Down
28 changes: 15 additions & 13 deletions sandbox/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/node": "^16.11.49",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"configcat-react": "file:..",
"configcat-react": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand Down
8 changes: 2 additions & 6 deletions sandbox/src/stories/Hoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,11 @@ export const HocPage = (args: { sdkKey: string, pollIntervalSeconds: number, fea
pollIntervalSeconds: args.pollIntervalSeconds,
logger: {
level: LogLevel.Debug,
debug(message) { log(message, 'debug'); },
info(message) { log(message, 'info'); },
error(message) { log(message, 'error'); },
warn(message) { log(message, 'warn'); },
log(message) { log(message, 'log'); },
log(level, _eventId, message, _ex) { log(message.toString(), LogLevel[level].toLowerCase()); }
},
setupHooks: (hooks) => {
hooks.on('clientReady', () => setConfigLastChanged(new Date()));
hooks.on('configChanged', newConfig =>setConfigLastChanged(new Date(newConfig.Timestamp)));
hooks.on('configChanged', _newConfig => setConfigLastChanged(new Date()));
}
}}>
<ConfigCatHocComponent featureFlagKey={args.featureFlagKey}></ConfigCatHocComponent>
Expand Down
10 changes: 3 additions & 7 deletions sandbox/src/stories/Hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ export const HookPage = (args: { sdkKey: string, pollIntervalSeconds: number, fe
pollIntervalSeconds: args.pollIntervalSeconds,
logger: {
level: LogLevel.Debug,
debug(message) { log(message, 'debug'); },
info(message) { log(message, 'info'); },
error(message) { log(message, 'error'); },
warn(message) { log(message, 'warn'); },
log(message) { log(message, 'log'); },
log(level, _eventId, message, _ex) { log(message.toString(), LogLevel[level].toLowerCase()); }
},
setupHooks: (hooks) => {
hooks.on('clientReady', ()=>setConfigLastChanged(new Date()));
hooks.on('configChanged', newConfig =>setConfigLastChanged(new Date(newConfig.Timestamp)));
hooks.on('clientReady', () => setConfigLastChanged(new Date()));
hooks.on('configChanged', _newConfig => setConfigLastChanged(new Date()));
}
}}>
<HookComponent featureFlagKey={args.featureFlagKey}></HookComponent>
Expand Down

0 comments on commit c82c306

Please sign in to comment.