The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/providers/SessionProvider.js

16 lines
488 B

import React from 'react';
import { Session } from 'meteor/session';
import { SessionContext } from '../contexts/SessionContext';
import { createObservableFromReactive } from './createObservableFromReactive';
const contextValue = {
get: createObservableFromReactive((name) => Session.get(name)),
set: (name, value) => {
Session.set(name, value);
},
};
export function SessionProvider({ children }) {
return <SessionContext.Provider children={children} value={contextValue} />;
}