This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function isValidUKPhone(phone: string) { | |
| const re = /^(\+44\d{10}\b)/; | |
| return re.test(phone); | |
| } | |
| describe('isValidUKPhone', () => { | |
| it('should return true as valid number', () => { | |
| const phone = '+447473222885'; | |
| expect(isValidUKPhone(phone)).toBeTruthy(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| βββ pages (SEO and Web related configuration) | |
| βββ server (node relates stuff. eg. Next.js) | |
| βββ static | |
| βββ src | |
| | βββ native (abstraction for cross-platform components) | |
| | βββ routing (abstraction for routing with routes) | |
| | βββ constcans (const variables) | |
| | βββ config (shared project configuration, env variables) | |
| | βββ constans () | |
| | βββ helpers (simple helpers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| βββ src | |
| | βββ orders (feature) | |
| | βββ asstes (type) | |
| | βββ orders.png | |
| | βββ components (type) | |
| | βββ order.jsx | |
| | βββ order-list.jsx | |
| | βββ order.styles.js/css | |
| | βββ logic (type) | |
| | βββ order.api.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| βββ src | |
| | βββ asstets (type) | |
| | βββ order.png | |
| | βββ components (type) | |
| | βββ common | |
| | βββ button.jsx | |
| | βββ avatar.jsx | |
| | βββ order.jsx | |
| | βββ order-list.jsx | |
| | βββ payment.jsx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| βββ src | |
| | βββ orders (feature - all things related to Orders should be in this folder ) | |
| | βββ order.styles.js/css | |
| | βββ order.api.js | |
| | βββ order.redux.js | |
| | βββ order.jsx | |
| | βββ order-list.jsx | |
| | βββ payments (feature - all things related to Payments should be in this folder ) | |
| | βββ payment.api.js | |
| | βββ payment.redux.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var obj = Immutable.fromJS({ data: 'Some data' }) | |
| obj.get('data') //Some data | |
| obj.data //undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var obj = Immutable.fromJS({ data: 'No data' }) | |
| var newObj = newObj.set('data', 'Mutated successfully') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var obj = Immutable({ data: 'No data' }) | |
| obj.data //No data | |
| // Note: There is getIn for nested objects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var obj = Immutable({ data: 'No data' }) | |
| var newObj = Immutable.set(obj, 'data', 'Mutated successfully') | |
| //Alternative | |
| var newObj = obj.set('data', 'Mutated successfully') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var array = Immutable.List([]) | |
| array[1] = "I'm going to mutate you!" | |
| array[1] // "I'm going to mutate you!" - while immutablejs has it's internal strucure | |
| // To update | |
| var newArray = array.push("I'm going to mutate you!") | |
| newArray.get(0) // "I'm going to mutate you!" | |
| newArray[0] // undefined |
NewerOlder