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
describe('Snapshot tests', () => { | |
it('work with objects', () => { | |
expect({ | |
a: 234, | |
b: 'test', | |
c: null, | |
d: undefined, | |
}).toMatchSnapshot(); | |
}); |
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
exports[`Snapshot tests work with arrays 1`] = ` | |
Array [ | |
"a", | |
5, | |
[Function], | |
] | |
`; | |
exports[`Snapshot tests work with objects 1`] = ` | |
Object { |
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
import { createElement, createContext, useReducer, useContext } from "react"; | |
const Context = createContext(); | |
export const ContextProvider = Context.Provider; | |
export const useStore = (reducer, initialState = {}) => { | |
const [state, dispatch] = useReducer(reducer, initialState); | |
const getState = () => state; |
OlderNewer