@rolloutly/react 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -6
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -107,17 +107,23 @@ if (showBanner) {
107
107
 
108
108
  Get all flag values as a key-value object. This is the recommended way to access multiple flags.
109
109
 
110
+ **CamelCase Support:** Flag keys with hyphens or underscores are automatically available in camelCase for easy destructuring!
111
+
110
112
  ```tsx
111
113
  const flags = useFlags();
112
114
 
113
- // Access by key
114
- const myFeature = flags['my-feature'];
115
+ // Access by original key
116
+ const myFeature = flags['instagram-integration'];
117
+
118
+ // Or use camelCase version (automatically available!)
119
+ const myFeature = flags.instagramIntegration;
115
120
 
116
- // Or destructure (use bracket notation for keys with dashes)
117
- const { 'new-checkout': newCheckout, 'show-banner': showBanner } = useFlags();
121
+ // Clean destructuring with camelCase
122
+ const { instagramIntegration, newCheckout, showBanner } = useFlags();
118
123
 
119
- // For keys without dashes, simple destructuring works
120
- const { myFeature, anotherFlag } = useFlags();
124
+ // Both formats work:
125
+ // 'instagram-integration' -> instagramIntegration
126
+ // 'my_feature_flag' -> myFeatureFlag
121
127
  ```
122
128
 
123
129
  ### `useRolloutly(): RolloutlyContextValue`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolloutly/react",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Rolloutly feature flags SDK - React hooks and provider",
5
5
  "author": "Kevin Beltrão",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "clean": "rm -rf dist"
45
45
  },
46
46
  "dependencies": {
47
- "@rolloutly/core": "^0.1.2"
47
+ "@rolloutly/core": "^0.1.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": ">=18.0.0"